Skip to content

Commit

Permalink
chore: CI: exempt drafts from PR body check (#6002)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kha authored Nov 8, 2024
1 parent dac73c1 commit 4f7aa8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pr-body.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Check PR body for changelog convention
on:
merge_group:
pull_request:
types: [opened, synchronize, reopened, edited, labeled]
types: [opened, synchronize, reopened, edited, labeled, converted_to_draft, ready_for_review]

jobs:
check-pr-body:
Expand All @@ -13,8 +13,8 @@ jobs:
uses: actions/github-script@v7
with:
script: |
const { title, body, labels } = context.payload.pull_request;
if (/^(feat|fix):/.test(title) && !labels.some(label => label.name == "changelog-no")) {
const { title, body, labels, draft } = context.payload.pull_request;
if (!draft && /^(feat|fix):/.test(title) && !labels.some(label => label.name == "changelog-no")) {
if (!labels.some(label => label.name.startsWith("changelog-"))) {
core.setFailed('feat/fix PR must have a `changelog-*` label');
}
Expand Down

0 comments on commit 4f7aa8c

Please sign in to comment.