Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
ci(github): fix PR label check
Browse files Browse the repository at this point in the history
  • Loading branch information
frgfm committed Mar 27, 2024
1 parent f8002bd commit 9e321a9
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,29 @@ jobs:
is-properly-labeled:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install requests
run: pip install requests
- uses: actions/checkout@v4
- name: Process commit and find merger responsible for labeling
id: commit
run: echo "::set-output name=merger::$(python .github/verify_labels.py ${{ github.event.pull_request.number }})"
run: |
MERGER=$(python .github/verify_labels.py ${{ github.event.pull_request.number }})
echo "merger=${MERGER}" | tee --append $GITHUB_OUTPUT
- name: Comment PR
uses: actions/github-script@v7
if: ${{ steps.commit.outputs.merger != '' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
github.issues.createComment({ issue_number, owner, repo, body: 'Hey ${{ steps.commit.outputs.merger }} 👋\nYou merged this PR, but it is not correctly labeled. The list of valid labels is available at https://github.com/quack-ai/companion/blob/main/.github/verify_labels.py' });
github.rest.issues.createComment({
issue_number,
owner,
repo,
body: 'Hey ${{ steps.commit.outputs.merger }} 👋\nYou merged this PR, but it is not correctly labeled. The list of valid labels is available at https://github.com/quack-ai/contribution-api/blob/main/.github/verify_labels.py'
});

0 comments on commit 9e321a9

Please sign in to comment.