Skip to content

Auto labels and draft #6

Auto labels and draft

Auto labels and draft #6

Workflow file for this run

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"