Conversation
…cross-workflow closes - Add GH_AW_CALLER_WORKFLOW_ID env var (= github.repository/github.workflow) to safe_outputs job so callers of the same reusable workflow can be distinguished at runtime - Use callerWorkflowId || workflowId as effectiveWorkflowId in create_issue.cjs and create_discussion.cjs for both the issue/discussion body marker and close-older search - Add exact-body post-search filter in close_older_issues.cjs and close_older_discussions.cjs to prevent GitHub search substring tokenization from matching related workflow IDs - Add body field to GraphQL discussion search query to enable exact-body filtering - Update tests with body fields in mock data and add new exact-marker filtering tests - Recompile all 165 lock files to propagate GH_AW_CALLER_WORKFLOW_ID Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot add a new xml tag gh-aw-workflow-call-id for the call identifier and leave the gh-aw-workflow-id tag unchanged |
…h-aw-workflow-id unchanged Per feedback: leave gh-aw-workflow-id unchanged and add a new gh-aw-workflow-call-id tag containing the caller's runtime identity (github.repository/github.workflow). - generate_footer.cjs: add generateWorkflowCallIdMarker() helper function - create_issue.cjs, create_discussion.cjs: - keep gh-aw-workflow-id: using compile-time workflowId (unchanged) - add gh-aw-workflow-call-id: using runtime callerWorkflowId when set - pass workflowId to closeOlderIssues and callerWorkflowId as separate filter param - close_older_issues.cjs, close_older_discussions.cjs: - searchOlderIssues/searchOlderDiscussions: add optional callerWorkflowId param - when callerWorkflowId set, filter by gh-aw-workflow-call-id marker (exact) - when not set, fall back to gh-aw-workflow-id marker (backward compat) - closeOlderIssues/closeOlderDiscussions: accept callerWorkflowId; pass via closure - Tests: add callerWorkflowId filter tests; update mock bodies in fallback test Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in 826b53c. The Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Fixes close-older-issues / close-older-discussions incorrectly closing items created by different caller workflows that share the same reusable workflow, by introducing a caller-unique marker and applying an exact-body post-search filter.
Changes:
- Add
GH_AW_CALLER_WORKFLOW_ID(runtime${{ github.repository }}/${{ github.workflow }}) to safe outputs job env. - Embed a new
<!-- gh-aw-workflow-call-id: ... -->marker in created issues/discussions and filter search results by exact marker presence when the caller ID is available. - Update discussion GraphQL search to fetch
bodyand expand tests/mocks to cover exact-marker filtering and caller disambiguation.
Reviewed changes
Copilot reviewed 168 out of 168 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/compiler_safe_outputs_job.go | Adds GH_AW_CALLER_WORKFLOW_ID to job-level env for safe outputs workflows. |
| pkg/workflow/compiler_safe_outputs_job_test.go | Updates expected env var set to include GH_AW_CALLER_WORKFLOW_ID. |
| actions/setup/js/generate_footer.cjs | Adds generateWorkflowCallIdMarker() helper and exports it. |
| actions/setup/js/create_issue.cjs | Embeds the new workflow-call-id marker when available and passes caller ID to closeOlderIssues. |
| actions/setup/js/create_discussion.cjs | Embeds the new workflow-call-id marker when available. |
| actions/setup/js/close_older_issues.cjs | Adds optional callerWorkflowId and exact-body filtering by either call-id or workflow-id marker. |
| actions/setup/js/close_older_issues.test.cjs | Adds body fields to mocks and new tests for exact marker filtering + caller ID filtering. |
| actions/setup/js/close_older_discussions.cjs | Extends GraphQL search to include body; adds optional callerWorkflowId and exact-body filtering. |
| actions/setup/js/close_older_discussions.test.cjs | Adds body fields to mocks and new tests for exact marker filtering + caller ID filtering. |
| actions/setup/js/create_discussion_fallback.test.cjs | Updates mocked issue search items to include body so the new exact-body filter passes. |
| .github/workflows/*.lock.yml | Recompiled workflows to include GH_AW_CALLER_WORKFLOW_ID in env. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let markerMismatchCount = 0; | ||
|
|
||
| const exactMarker = callerWorkflowId ? `<!-- gh-aw-workflow-call-id: ${callerWorkflowId} -->` : `<!-- gh-aw-workflow-id: ${workflowId} -->`; | ||
|
|
There was a problem hiding this comment.
The exact marker string is reconstructed inline. Since this format is now shared across multiple modules, consider generating it via the shared footer helpers (e.g., generateWorkflowCallIdMarker / generateWorkflowIdMarker) to avoid future mismatches if the marker format changes.
| let markerMismatchCount = 0; | ||
|
|
||
| const exactMarker = callerWorkflowId ? `<!-- gh-aw-workflow-call-id: ${callerWorkflowId} -->` : `<!-- gh-aw-workflow-id: ${workflowId} -->`; | ||
|
|
There was a problem hiding this comment.
The marker string is assembled inline here. To avoid format drift (the marker is also produced in generate_footer.cjs and embedded by create_issue/create_discussion), consider using the shared marker generator helpers when building exactMarker.
|
@copilot fix https://github.com/github/gh-aw/actions/runs/22578250194/job/65407668590 and previous comment |
…ose_older_*.cjs
- close_older_issues.cjs, close_older_discussions.cjs:
- Import generateWorkflowIdMarker and generateWorkflowCallIdMarker from generate_footer.cjs
- Use shared helpers instead of inline template strings for exactMarker construction
- Fix TS2556 'spread argument must have tuple type': replace ...args spread closures
with explicit parameter lists (excludeNumber for issues, categoryId+excludeNumber
for discussions)
- generate_footer.test.cjs:
- Add generateWorkflowCallIdMarker to describe block variables/imports
- Add tests for generateWorkflowCallIdMarker: basic format, slashes, empty string,
differentiation from generateWorkflowIdMarker, and XML comment format regex
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in e610db2:
|
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
Agent Container Tool Check
Result: 12/12 tools available ✅ Overall Status: PASS
|
|
🤖 Smoke test §22580657435 —
Overall: FAIL (Serena MCP unavailable)
|
There was a problem hiding this comment.
This PR introduces GH_AW_CALLER_WORKFLOW_ID to fix cross-workflow issue contamination in close-older-issues. The approach is sound — using a runtime ${{ github.repository }}/${{ github.workflow }} expression provides unique caller identity for reusable workflows. Two minor suggestions: (1) consider a shared marker helper in generate_footer.cjs to reduce duplication, (2) the env var comment could clarify it's an Actions expression. Overall a clean, well-tested fix.
📰 BREAKING: Report filed by Smoke Copilot
| // same GH_AW_WORKFLOW_ID (derived from the reusable file). This separate runtime | ||
| // value uniquely identifies each caller and is used as the issue/discussion marker | ||
| // for close-older-issues, preventing cross-caller false closes. | ||
| envVars["GH_AW_CALLER_WORKFLOW_ID"] = `"${{ github.repository }}/${{ github.workflow }}"` |
There was a problem hiding this comment.
The GH_AW_CALLER_WORKFLOW_ID env var is set to a GitHub Actions expression string (not the actual value). This is correct since it will be evaluated at runtime, but it may be worth adding a comment clarifying that this is an Actions expression — the quoted $\{\{ ... }} is intentional and won't be a literal string at runtime.
| * @param {string} callerWorkflowId - Calling workflow identifier (e.g. "owner/repo/WorkflowName") | ||
| * @returns {string} Standalone workflow-call-id XML comment marker | ||
| */ | ||
| function generateWorkflowCallIdMarker(callerWorkflowId) { |
There was a problem hiding this comment.
Nice addition of generateWorkflowCallIdMarker. The function mirrors generateWorkflowIdMarker but uses gh-aw-workflow-call-id — consider extracting the common XML comment pattern into a shared helper (e.g., generateMarker(key, value)) to reduce duplication and make future marker additions even simpler.
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
Commit pushed:
|
Smoke Test Results — Run 22580657419
Overall: PARTIAL — Test 3 (Serena find_symbol) failed with EOF
|
There was a problem hiding this comment.
💥 Automated smoke test review - all systems nominal!
💥 [THE END] — Illustrated by Smoke Claude
GH_AW_CALLER_WORKFLOW_IDenv var to safe_outputs job (set to${{ github.repository }}/${{ github.workflow }}at runtime to uniquely identify the calling workflow)generateWorkflowCallIdMarker()togenerate_footer.cjscreate_issue.cjsandcreate_discussion.cjs: keepgh-aw-workflow-idwith compile-timeworkflowId; add NEWgh-aw-workflow-call-idwith runtimecallerWorkflowIdwhen setclose_older_issues.cjs: filter bygh-aw-workflow-call-idwhencallerWorkflowIdis set, else fall back togh-aw-workflow-id; use shared helper functions for marker constructionclose_older_discussions.cjs: same pattern as issues +bodyin GraphQL query; use shared helper functions...argsspread closures with explicit parameter listsgenerateWorkflowCallIdMarker()ingenerate_footer.test.cjstsc --noEmitexits 0)Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.
Changeset
Warning
The following domains were blocked by the firewall during workflow execution:
codeload.github.comgithub.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
✨ PR Review Safe Output Test - Run 22580657419