Skip to content

Commit 1af92e3

Browse files
chore: don't fail the PR description check for draft PRs (#7930)
1 parent de6fa18 commit 1af92e3

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

.github/workflows/validate-pr-description.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,21 @@ name: Validate PR Description
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened, labeled, unlabeled, edited]
5+
types:
6+
[
7+
opened,
8+
synchronize,
9+
reopened,
10+
labeled,
11+
unlabeled,
12+
edited,
13+
ready_for_review,
14+
converted_to_draft,
15+
]
616

717
jobs:
818
check:
19+
# Don't check the Version Packages PR
920
if: github.head_ref != 'changeset-release/main'
1021
concurrency:
1122
group: ${{ github.workflow }}-${{ github.ref }}-add-pr
@@ -47,3 +58,4 @@ jobs:
4758
BODY: ${{ github.event.pull_request.body }}
4859
LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}
4960
FILES: ${{ steps.files.outputs.all }}
61+
DRAFT: ${{ github.event.pull_request.draft }}

tools/deployments/validate-pr-description.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ if (require.main === module) {
1111
for (const error of errors) {
1212
console.error("- ", error);
1313
}
14-
process.exit(1);
14+
if (process.env.DRAFT !== "true") {
15+
process.exit(1);
16+
} else {
17+
console.error("These errors must be fixed before you can merge this PR.");
18+
console.error(
19+
"When you mark this PR as ready for review the CI check will start failing."
20+
);
21+
}
1522
}
1623
}
1724

0 commit comments

Comments
 (0)