From 4c4453b489cf76e6b3b0f300aba663eb78182fad Mon Sep 17 00:00:00 2001 From: Franz Busch Date: Mon, 5 Aug 2024 14:41:20 +0200 Subject: [PATCH] [CI] Fix label check (#2827) # Motivation The label check workflow doesn't seem to work properly. # Modification This PR fixes it. # Result Proper label checks. --- .../pull_request_semver_label_checker/action.yml | 15 +++++++++++++-- .github/workflows/pull_request_label.yml | 8 ++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/actions/pull_request_semver_label_checker/action.yml b/.github/actions/pull_request_semver_label_checker/action.yml index 91d5e55f12..2b568e1547 100644 --- a/.github/actions/pull_request_semver_label_checker/action.yml +++ b/.github/actions/pull_request_semver_label_checker/action.yml @@ -1,9 +1,20 @@ -name: 'Pull request semver label checker' -description: 'Checks that at least one semver label is applied to the pull request' +name: 'Pull request Semantic Version label checker' + +description: 'Checks that at least one Semantic Version label is applied to the pull request' + +inputs: + token: + description: 'A GitHub token' + type: string + default: ${{ github.token }} + runs: using: "composite" steps: - name: Check labels + shell: bash + env: + GH_TOKEN: ${{ inputs.token }} run: | gh pr view ${{ github.event.number }} --repo apple/swift-nio --json labels \ | jq -e '[.labels[].name] | any(. == "semver/major" or . == "semver/minor" or . == "semver/patch" or . == "semver/none")' \ No newline at end of file diff --git a/.github/workflows/pull_request_label.yml b/.github/workflows/pull_request_label.yml index 32baf7a54f..2564e7b031 100644 --- a/.github/workflows/pull_request_label.yml +++ b/.github/workflows/pull_request_label.yml @@ -1,4 +1,4 @@ -name: PR +name: PR label on: pull_request: @@ -6,11 +6,11 @@ on: jobs: semver-label-check: - name: Semver label check + name: Semantic Version label check runs-on: ubuntu-latest timeout-minutes: 1 steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Check for semver label - uses: ".github/actions/pull_request_semver_label_checker/action.yml" + - name: Check for Semantic Version label + uses: ./.github/actions/pull_request_semver_label_checker/