Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sanidhyas3s authored Aug 28, 2024
1 parent a9edbcd commit 70eab3b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/label-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,27 @@ jobs:
manage-labels:
runs-on: ubuntu-latest
steps:
- name: Set up GitHub CLI
uses: gh-actions/cli@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Add 'waiting for review' label if review is requested
if: github.event_name == 'pull_request' && github.event.action == 'review_requested'
run: |
gh pr edit ${{ github.event.pull_request.number }} --add-label "waiting for review"
env:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Add 'waiting for update' label if changes are requested
if: github.event_name == 'pull_request_review' && github.event.review.state == 'changes_requested'
run: |
gh pr edit ${{ github.event.pull_request.number }} --add-label "waiting for update"
env:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Remove 'waiting for update' label if a comment is made by the author
if: github.event_name == 'issue_comment'
run: |
comment_author=$(gh pr view ${{ github.event.issue.number }} --json author --jq '.author.login')
if [ "$comment_author" == "${{ github.actor }}" ]; then
gh pr edit ${{ github.event.issue.number }} --remove-label "waiting for update"
fi
fi
env:
github_token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 70eab3b

Please sign in to comment.