Skip to content

Instantly share code, notes, and snippets.

@hidakatsuya
Created September 24, 2025 16:47
Show Gist options
  • Save hidakatsuya/700a3f22fad33d36d978eeebc7a61d37 to your computer and use it in GitHub Desktop.
Save hidakatsuya/700a3f22fad33d36d978eeebc7a61d37 to your computer and use it in GitHub Desktop.
Get Redmine system test failures from GitHub Actions
#!/bin/bash
REPO="redmine/redmine"
WORKFLOW_NAME="Tests"
LIMIT=100
run_ids=$(gh run list --workflow="$WORKFLOW_NAME" --limit "$LIMIT" --repo "$REPO" --json databaseId -q '.[].databaseId')
echo "Checking system test jobs for non-zero exit codes..."
for run_id in $run_ids; do
job_id=$(gh run view "$run_id" --repo "$REPO" --json jobs -q '.jobs[] | select(.name=="system test") | .databaseId')
if [ -z "$job_id" ]; then
continue
fi
if gh run view "$run_id" --job "$job_id" --repo "$REPO" | grep -q "Process completed with exit code [^0]"; then
echo "Run ID: $run_id, Job ID: $job_id FAILED"
echo "https://github.com/$REPO/actions/runs/$run_id/job/$job_id"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment