We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6445b8d commit f74c893Copy full SHA for f74c893
.github/workflows/fail-conditional.yml
@@ -0,0 +1,27 @@
1
+name: 'conditional-fail'
2
+
3
+on:
4
+ pull_request:
5
+ branches: [ 'dont_run_me' ]
6
7
+jobs:
8
+ fail_on_commit_message:
9
+ runs-on: 'ubuntu-latest'
10
+ steps:
11
+ - name: 'Checkout code'
12
+ uses: 'actions/checkout@v4'
13
14
+ - name: 'Check for "fail" in commit message'
15
+ id: 'check_commit'
16
+ run: |
17
+ COMMIT_MESSAGE=$(git log -1 --pretty=%B)
18
+ if echo "$COMMIT_MESSAGE" | grep -qi "fail"; then
19
+ echo "found_fail=true" >> "$GITHUB_OUTPUT"
20
+ fi
21
22
+ - name: 'Fail Step'
23
+ if: steps.check_commit.outputs.found_fail == 'true'
24
25
+ echo 'Failing because "fail" was found in the commit message.'
26
+ exit 1
27
0 commit comments