Skip to content

close-older-issues closes issues from different calling workflows #19172

Description

@strawgate

Problem

Explore: Live Elasticsearch closed elastic/ai-github-actions-playground#1138, which belongs to medium-ideas-man.

When multiple workflows call the same reusable workflow via workflow_call, close-older-issues can't distinguish between them:

1. Shared workflow ID. GH_AW_WORKFLOW_ID is derived from the reusable workflow's filename at compile time, not the caller's. All callers of gh-aw-internal-gemini-cli.lock.yml share the same ID and close each other's issues.

2. Search substring matching. GitHub search for "gh-aw-workflow-id: gh-aw-internal-gemini-cli" also matches issues containing gh-aw-internal-gemini-cli-web-search, crossing even different reusable workflows. Adding --> to the query doesn't help — GitHub tokenizes on HTML comment delimiters.

Suggested fixes

Workflow ID: Incorporate the calling workflow's identity into the marker. Within a workflow_call, ${{ github.repository }}/${{ github.workflow }} would uniquely identify the caller across repos. Since GH_AW_WORKFLOW_ID is also used for branch names, this likely needs a separate env var for the marker.

Search precision: GitHub search can't exact-match these markers, so add a post-search filter on the issue body — the same pattern findCommentsWithTrackerId already uses:

const exactMarker = `<!-- gh-aw-workflow-id: ${workflowId} -->`;
const filtered = results.filter(item => item.body?.includes(exactMarker));

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions