Fix issue-to-PR handoff when created issue output is empty#603
Fix issue-to-PR handoff when created issue output is empty#603
Conversation
Resolve the created issue number from run outputs first, then fall back to searching issues by current run URL in body so chained create-pr jobs still run when created_issue_number output is unexpectedly empty.
Replace issue-search fallback with direct extraction of create_issue number from same-run safe-output-items artifact, so issue-to-PR chaining relies only on deterministic workflow outputs.
scripts/dogfood.sh
Outdated
| if [ -z "$number" ]; then | ||
| number="$(gh issue list \ | ||
| --repo "$REPOSITORY" \ | ||
| --search "in:body \"actions/runs/$RUN_ID\" author:github-actions[bot] is:issue" \ |
There was a problem hiding this comment.
[HIGH] Fallback issue lookup is restricted to a single author
The resolver only searches for issues authored by github-actions[bot], but issue creation in these workflows uses $\{\{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}. When GH_AW_GITHUB_TOKEN is set to a different bot/user token, the issue is created by that actor, this query returns nothing, and create_pr_from_issue is skipped even though an issue exists.
| --search "in:body \"actions/runs/$RUN_ID\" author:github-actions[bot] is:issue" \ | |
| --search "in:body \"actions/runs/$RUN_ID\" is:issue" \ |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis change updates multiple GitHub Actions workflows and the helper script to split a single-step flow into two stages: a new resolve_created_issue job is added that computes and exposes created_issue_number and created_issue_url (via a gh call) as job outputs; existing create_pr_from_issue jobs now depend on resolve_created_issue, consume Possibly related PRs
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Add created_issue_url alongside created_issue_number in generated resolve_created_issue outputs so downstream jobs can consume stable issue metadata directly from workflow outputs.
Keep created_issue_number sourced from the originating workflow output and pass it into resolve_created_issue only for URL enrichment, avoiding duplicate number propagation through the resolver job.
Summary
create_pr_from_issuejob was skippedresolve_created_issuejob for remediation workflows that:needs.run.outputs.created_issue_numberwhen presentactions/runs/URL in the issue bodycreate_pr_from_issueto consume the resolved issue number output from this resolver jobscripts/dogfood.shso regenerated trigger workflows keep this resolver-and-handoff behaviorWhy this fixes it
In the observed run,
safe-output-itemscontained a successfulcreate_issueentry, but therunreusable-workflow output used by trigger chaining was empty. The fallback resolver makes the handoff robust to that output gap.Test plan
./scripts/dogfood.shmake lint-workflows.github/workflows/trigger-text-auditor.yml.github/workflows/trigger-docs-patrol.yml.github/workflows/trigger-framework-best-practices.ymlscripts/dogfood.shthat appends and wires the remediation chainThe body of this PR is automatically managed by the Trigger Update PR Body workflow.