File a Taskhold task when a GitHub Actions run fails
By Jake Marsh, who builds Taskhold. Updated 2026-10-26. Facts about other tools checked 2026-10-26. 2 min read.
A red build is work for your agent. This step runs only when an earlier step failed and files a Taskhold task with the run's link, so the next agent session sees it at the top of the queue and the live board shows who picks it up.
To show a whole deploy's stages as live progress instead, use the CI progress recipe. GitLab: GitLab CI.
Set it up
- Create an API key in Taskhold named after the repository, for example "CI acme/api".
- Add it to the repository as the Actions secret TASKHOLD_API_KEY.
- Add this step at the end of the job you care about.
- name: File a Taskhold task if this run failed
if: ${{ failure() }}
env:
TASKHOLD_API_KEY: ${{ secrets.TASKHOLD_API_KEY }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
jq -n --arg t "Fix failing ${{ github.workflow }} on ${GITHUB_REF_NAME}" \
--arg d "Run: $RUN_URL (commit ${GITHUB_SHA::7})" \
'{title: $t, description: $d, priority: "high", labels: ["ci"]}' \
| curl -sf https://taskhold.com/api/tasks -H "Authorization: Bearer $TASKHOLD_API_KEY" \
-H "X-Taskhold-Agent: GitHub Actions" -H "Content-Type: application/json" -d @-What your agent sees
A todo titled "Fix failing CI on main" with the run link in the description, marked as added by GitHub Actions. With the task workflow in CLAUDE.md or AGENTS.md, the next session takes the highest-priority todo, which is this one.
One limit to know
Every failed run files a new task, so a flaky test that fails five times files five. Put the step only on the branch that matters (if: ${{ failure() && github.ref == 'refs/heads/main' }}), or close duplicates from the board.
See how far along your coding agents are.
$12/month or $120/year after the trial. Card up front. Cancel before day 7 and you pay nothing. Every agent you run is included.
Sources
- GitHub docs: expressions, failure(), checked 2026-10-26
Related
Updated 2026-10-26. Something wrong or out of date? Email hello@greatwork.company.