Skip to content

Fix branch name in test failure conditions #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: breaking-change
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/github-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
npm test # Replace with the appropriate test command for your app

- name: Simulate failure scenario
if: github.ref == 'refs/heads/test-failures'
if: github.ref == 'refs/heads/test-failure'
run: |
echo "Simulating build failure"
exit 1

- name: Simulate syntax error
if: github.ref == 'refs/heads/test-failures'
if: github.ref == 'refs/heads/test-failure'
run: |
bash -c 'echo "Simulating syntax error"; if [ true ]; then echo "missing fi"'
Comment on lines 34 to 35
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Intentionally malformed bash syntax could cause pipeline debugging issues. Consider using a clearer failure simulation method.

Comment on lines 26 to 35

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Consolidate duplicate workflow steps

Suggested change
- name: Simulate failure scenario
if: github.ref == 'refs/heads/test-failures'
if: github.ref == 'refs/heads/test-failure'
run: |
echo "Simulating build failure"
exit 1
- name: Simulate syntax error
if: github.ref == 'refs/heads/test-failures'
if: github.ref == 'refs/heads/test-failure'
run: |
bash -c 'echo "Simulating syntax error"; if [ true ]; then echo "missing fi"'
- name: Run test failure simulations
if: github.ref == 'refs/heads/test-failure'
run: |
echo "Simulating build failure"
exit 1
echo "Simulating syntax error"
bash -c 'echo "Simulating syntax error"; if [ true ]; then echo "missing fi"'