Skip to content

Commit

Permalink
Add PR label workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sanidhyas3s authored Aug 28, 2024
1 parent 30d440a commit 0e50c3c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/label-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Auto Label PRs

on:
pull_request:
types: [review_requested, synchronize, reopened]
issue_comment:
types: [created]

jobs:
update-labels:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Remove 'waiting for changes' and Add 'waiting for review' label
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: waiting for review

- name: Remove 'waiting for changes' label if exists
run: |
if gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name' | grep -q 'waiting for changes'; then
gh pr edit ${{ github.event.pull_request.number }} --remove-label "waiting for changes"
fi

0 comments on commit 0e50c3c

Please sign in to comment.