Auto labels and draft #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR Automation | |
on: | |
pull_request: | |
types: | |
- opened | |
- ready_for_review | |
- converted_to_draft | |
permissions: | |
pull-requests: write | |
jobs: | |
pr-automation: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Add WIP Label on Open | |
if: github.event.action == 'opened' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
PR_NUMBER=$(gh pr view --json number --jq .number) | |
gh issue edit "$PR_NUMBER" --add-label "WIP" | |
- name: Add WIP Label on Draft | |
if: github.event.action == 'converted_to_draft' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
PR_NUMBER=$(gh pr view --json number --jq .number) | |
gh issue edit "$PR_NUMBER" --add-label "WIP" | |
- name: Remove WIP and Add Ready Label | |
if: github.event.action == 'ready_for_review' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
PR_NUMBER=$(gh pr view --json number --jq .number) | |
gh issue edit "$PR_NUMBER" --remove-label "WIP" --add-label "ready-for-review" |