Skip to content

Commit 45ca5a5

Browse files
committed
github action exits with code 1
1 parent 94174be commit 45ca5a5

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/fail.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Failure Simulator
2+
3+
# This triggers on every push or can be run manually from the Actions tab
4+
on:
5+
push:
6+
workflow_dispatch:
7+
8+
jobs:
9+
simulate-failure:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Log Intent
16+
run: echo "Starting the workflow... everything looks fine so far."
17+
18+
- name: Force Exit with Error
19+
run: |
20+
echo "Error: A simulated critical failure has occurred!"
21+
# Any non-zero exit code tells GitHub the step failed
22+
exit 1
23+
24+
- name: This won't run
25+
run: echo "You will never see this message because the step above failed."

0 commit comments

Comments
 (0)