1name: labels 2 3on: 4 pull_request_target: 5 types: [ opened, synchronize, reopened, converted_to_draft, ready_for_review ] 6 7permissions: 8 pull-requests: write 9 10jobs: 11 open: 12 runs-on: ubuntu-latest 13 if: ${{ github.event.action == 'opened' && github.event.pull_request.draft }} 14 steps: 15 - env: 16 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 17 ISSUE: ${{ github.event.pull_request.html_url }} 18 run: | 19 gh pr edit $ISSUE --add-label "Status: Work in Progress" 20 21 push: 22 runs-on: ubuntu-latest 23 if: ${{ github.event.action == 'synchronize' || github.event.action == 'reopened' }} 24 steps: 25 - env: 26 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 27 ISSUE: ${{ github.event.pull_request.html_url }} 28 run: | 29 gh pr edit $ISSUE --remove-label "Status: Accepted,Status: Inactive,Status: Revision Needed,Status: Stale" 30 31 draft: 32 runs-on: ubuntu-latest 33 if: ${{ github.event.action == 'converted_to_draft' }} 34 steps: 35 - env: 36 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 37 ISSUE: ${{ github.event.pull_request.html_url }} 38 run: | 39 gh pr edit $ISSUE --remove-label "Status: Accepted,Status: Code Review Needed,Status: Inactive,Status: Revision Needed,Status: Stale" --add-label "Status: Work in Progress" 40 41 rfr: 42 runs-on: ubuntu-latest 43 if: ${{ github.event.action == 'ready_for_review' }} 44 steps: 45 - env: 46 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 47 ISSUE: ${{ github.event.pull_request.html_url }} 48 run: | 49 gh pr edit $ISSUE --remove-label "Status: Accepted,Status: Inactive,Status: Revision Needed,Status: Stale,Status: Work in Progress" --add-label "Status: Code Review Needed" 50