goatscript #1: run-with-summary #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Test the scripts. | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| run-with-summary: | |
| runs-on: ubuntu-latest | |
| # Settings for run-with-summary script. | |
| env: | |
| FILE: report-${{ github.run_id }}.md | |
| SUCCESS: "Ping Successful" | |
| FAILURE: "Ping Failed" | |
| SUMMARY: yes | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: run-with-summary | |
| run: | | |
| set -o pipefail | |
| set +e | |
| ./src/run-with-summary ping github.com -c5 | |
| exit_code=$? | |
| cat $FILE >> $GITHUB_STEP_SUMMARY | |
| exit $exit_code | |
| 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 -c5 | |
| exit_code=$? | |
| cat $FILE >> $GITHUB_STEP_SUMMARY | |
| exit $exit_code |