[bug-hunter] trigger-ci-workflows exits 0 even when workflow dispatches fail
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Start in scripts/trigger-ci-workflows.sh, focusing on the dispatch loop and summary section near the end where failed is declared and dispatch errors are logged. Run the supplied gh shim reproduction and verify that failed dispatches produce a non-zero exit status while successful dispatches retain the current behavior.
Written by the indexing model from the issue text.
Description
Impact
scripts/trigger-ci-workflows.sh exits with status 0 even when every workflow dispatch fails. Any automation or maintainer script relying on exit status treats the run as successful, so dispatch failures are silently missed.
Reproduction Steps
- From repository root, create a
ghshim that forcesgh workflow runto fail:mkdir -p /tmp/gh-aw/agent/ghshim cat > /tmp/gh-aw/agent/ghshim/gh <<'SH' #!/usr/bin/env bash if [ "$1" = "workflow" ] && [ "$2" = "run" ]; then exit 1 fi exit 0 SH chmod +x /tmp/gh-aw/agent/ghshim/gh - Run the script with that shim first on
PATH:PATH="/tmp/gh-aw/agent/ghshim:$PATH" bash scripts/trigger-ci-workflows.sh detectors echo "exit_code=$?"
Expected vs Actual
Expected: non-zero exit status when one or more workflow dispatches fail (especially when all fail).
Actual: script prints multiple dispatch failed errors but exits 0.
Observed output:
## Detectors
Attempted to dispatch 13 workflows across 1 categories.
exit_code=0
stderr contained 13 failure lines like:
✗ Trigger Bug Hunter (dispatch failed)
Failing Test
#!/usr/bin/env bash
set -euo pipefail
mkdir -p /tmp/gh-aw/agent/ghshim
cat > /tmp/gh-aw/agent/ghshim/gh <<'SH'
#!/usr/bin/env bash
if [ "$1" = "workflow" ] && [ "$2" = "run" ]; then
exit 1
fi
exit 0
SH
chmod +x /tmp/gh-aw/agent/ghshim/gh
set +e
PATH="/tmp/gh-aw/agent/ghshim:$PATH" bash scripts/trigger-ci-workflows.sh detectors >/tmp/gh-aw/agent/repro.out 2>/tmp/gh-aw/agent/repro.err
code=$?
set -e
echo "exit_code=$code"
cat /tmp/gh-aw/agent/repro.err
if [ "$code" -eq 0 ]; then
echo "FAIL: script reported success despite dispatch failures"
exit 1
fi
Evidence
scripts/trigger-ci-workflows.shdeclaresfailed=0but never increments it and never exits non-zero on failures.- In the dispatch loop, the failure path only logs
✗ ... (dispatch failed)to stderr. - Current file reference:
scripts/trigger-ci-workflows.sh(dispatch loop and summary section near the end of the file). - This appears to match a previously fixed class of bug from #315 and is reproducible again on current
main.
What is this? | From workflow: Trigger Bug Hunter
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
- expires on Sep 25, 2026, 11:27 AM UTC
- Dominant language
- Python
- Stars
- 11
- Forks
- 16
- Avg merge
- 11h 16m
- Merged PRs (30d)
- 29
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from elastic/ai-github-actions
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
elastic/ai-github-actions#2142 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
elastic/ai-github-actions#2132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
elastic/ai-github-actions#2126 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
elastic/ai-github-actions#2121 ·
-
text-auditor
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
elastic/ai-github-actions#2120 ·
All issues in elastic/ai-github-actions
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100