Skip to content

Commit

Permalink
feat: adds a github action to auto label draft prs (apache#31518)
Browse files Browse the repository at this point in the history
  • Loading branch information
sadpandajoe authored Jan 8, 2025
1 parent 0eca79c commit 210537a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/actions/change-detector/label-draft-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Label Draft PRs
on:
pull_request:
types:
- opened
- converted_to_draft
jobs:
label-draft:
runs-on: ubuntu-latest
steps:
- name: Check if the PR is a draft
id: check-draft
uses: actions/github-script@v6
with:
script: |
const isDraft = context.payload.pull_request.draft;
core.setOutput('isDraft', isDraft);
- name: Add `review:draft` Label
if: steps.check-draft.outputs.isDraft == 'true'
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: "review:draft"

0 comments on commit 210537a

Please sign in to comment.