Skip to content

Commit

Permalink
fixup! de-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
afuller-TT committed Mar 7, 2025
1 parent 096ea92 commit 8fb3011
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions .github/workflows/pr-gate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check if all jobs passed
shell: bash
run: |
set -euo pipefail
# Required jobs
if [[ "${{ needs.pr-gate-build.outcome }}" != "success" ]]; then
echo "Some job(s) did not succeed."
exit 1
fi
uses: actions/github-script@v7
with:
script: |
const requiredJobs = ["pr-gate-build"];
const optionalJobs = ["smoke-tests"];
# Optional jobs
# These may be 'skipped' (neither success nor failure) if they were not required.
# Treat skipped as success.
if [[ "${{ needs.smoke-tests }}" == "failure" ]]; then
echo "Some job(s) failed."
exit 1
fi
for (const job of requiredJobs) {
if (context.payload.workflow_run.jobs[job].outcome !== "success") {
core.setFailed(`Required job '${job}' did not succeed.`);
}
}
echo "Workflow was successful."
for (const job of optionalJobs) {
const outcome = context.payload.workflow_run.jobs[job]?.outcome;
if (outcome === "failure") {
core.setFailed(`Optional job '${job}' failed.`);
}
}
console.log("Workflow was successful.");

0 comments on commit 8fb3011

Please sign in to comment.