summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-06-04 20:51:27 -0400
committerGitHub <noreply@github.com>2024-06-04 20:51:27 -0400
commit0544d60012006b1c7799d8b6eafacec9567901ad (patch)
tree57ec91bb1830722c3f7a29e040c8d44ecbc4cd02
parenteb218c0f3344eabfa8abf4c7ecac148f14fc6294 (diff)
ci: label for running CI on draft PRs (#24102)
-rwxr-xr-x.github/workflows/ci.generate.ts3
-rw-r--r--.github/workflows/ci.yml4
2 files changed, 4 insertions, 3 deletions
diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts
index 943017c8b..929d98660 100755
--- a/.github/workflows/ci.generate.ts
+++ b/.github/workflows/ci.generate.ts
@@ -339,10 +339,11 @@ const ci = {
...cloneRepoStep,
{
id: "check",
+ if: "!contains(github.event.pull_request.labels.*.name, 'ci-draft')",
run: [
"GIT_MESSAGE=$(git log --format=%s -n 1 ${{github.event.after}})",
"echo Commit message: $GIT_MESSAGE",
- "echo $GIT_MESSAGE | grep '\\[ci\\]' || (echo 'Exiting due to draft PR. Commit with [ci] to bypass.' ; echo 'skip_build=true' >> $GITHUB_OUTPUT)",
+ "echo $GIT_MESSAGE | grep '\\[ci\\]' || (echo 'Exiting due to draft PR. Commit with [ci] to bypass or add the ci-draft label.' ; echo 'skip_build=true' >> $GITHUB_OUTPUT)",
].join("\n"),
},
]),
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2e54d1b7c..f831a6c06 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -37,11 +37,11 @@ jobs:
submodules: false
if: github.event.pull_request.draft == true
- id: check
+ if: 'github.event.pull_request.draft == true && (!contains(github.event.pull_request.labels.*.name, ''ci-draft''))'
run: |-
GIT_MESSAGE=$(git log --format=%s -n 1 ${{github.event.after}})
echo Commit message: $GIT_MESSAGE
- echo $GIT_MESSAGE | grep '\[ci\]' || (echo 'Exiting due to draft PR. Commit with [ci] to bypass.' ; echo 'skip_build=true' >> $GITHUB_OUTPUT)
- if: github.event.pull_request.draft == true
+ echo $GIT_MESSAGE | grep '\[ci\]' || (echo 'Exiting due to draft PR. Commit with [ci] to bypass or add the ci-draft label.' ; echo 'skip_build=true' >> $GITHUB_OUTPUT)
build:
name: '${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}-${{ matrix.arch }}'
needs: