Skip to content

Get a failure check working. #18

Get a failure check working.

Get a failure check working. #18

Workflow file for this run

# Test the scripts.

Check failure on line 1 in .github/workflows/scripts.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/scripts.yaml

Invalid workflow file

(Line: 44, Col: 7): 'run' is already defined, (Line: 51, Col: 7): There's not enough info to determine what you meant. Add one of these properties: run, shell, uses, with, working-directory
on:
pull_request:
branches:
- main
# Settings for run-with-summary script.
env:
FILE: report-${{ github.run_id }}.md
SUMMARY: yes
jobs:
run-with-summary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: run-with-summary
run: |
set -o pipefail
set +e
./src/run-with-summary ps -a
exit_code=$?
cat $FILE >> $GITHUB_STEP_SUMMARY
echo "EXIT_CODE=$exit_code" >> $GITHUB_ENV
run-with-summary-fail:
runs-on: ubuntu-latest
env:
FILE: report-${{ github.run_id }}.md
steps:
- uses: actions/checkout@v4
- name: run-with-summary failure
run: |
set -o pipefail
set +e
./src/run-with-summary ping w3.org -c1
exit_code=$?
cat $FILE >> $GITHUB_STEP_SUMMARY
echo "EXIT_CODE=$exit_code" >> $GITHUB_ENV
run: |
if [ "$EXIT_CODE" == "0" ]; then
echo "Script was expected to fail. Something is wrong."
exit 1
else
echo "Exit code is not 0, as expected."
fi
- name: Exit