Skip to content

Set GH_REPO so gh cache delete can resolve the target repository in the promote action - #109

Merged
jeffhandley merged 1 commit into
mainfrom
jeffhandley/promote-failure
Jun 12, 2026
Merged

jeffhandley merged 1 commit into
mainfrom
jeffhandley/promote-failure

Conversation

@jeffhandley

Copy link
Copy Markdown
Member

Summary

Fix the Labeler: Promotion workflow failing at the "Delete Existing Active Cache Entry" step.

Cause

The promote/action.yml composite action invokes gh cache delete without a checkout, so gh has no git remote from which to infer the target repository and exits before making the API call:

gh cache delete "issue-labeler/model/issues/ACTIVE"
failed to determine base repo: failed to run git: fatal: not a git repository (or any of the parent directories): .git
##[error]Process completed with exit code 1.

Observed in consumer runs such as microsoft/aspire #23395851258 and dotnet/sdk #17777754813. This is not a permissions issue — actions: write and GH_TOKEN are already set; gh fails before reaching the API.

Change

  • Add GH_REPO: ${{ github.repository }} to the env block of the "Delete Existing Active Cache Entry" step in promote/action.yml.

Impact

  • Consumers reference dotnet/issue-labeler/promote@main and need no changes on their side.
  • No behavior change for gh cache delete other than restoring the ability to resolve the target repository.

- Pass `GH_REPO: ${{ github.repository }}` alongside `GH_TOKEN` so `gh cache delete` resolves the target repository without a git checkout.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 12, 2026 21:40
@jeffhandley
jeffhandley requested a review from swathipil June 12, 2026 21:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the Labeler: Promotion workflow failure in the promote composite action by ensuring gh cache delete can resolve the target repository even when no repository checkout is present (no .git directory to infer the remote).

Changes:

  • Set GH_REPO to ${{ github.repository }} for the cache-deletion step so gh can determine the base repo.
  • Restore successful execution of the “Delete Existing Active Cache Entry” step in consumer workflows.

@jeffhandley
jeffhandley merged commit e608cf8 into main Jun 12, 2026
4 of 6 checks passed
@jeffhandley
jeffhandley deleted the jeffhandley/promote-failure branch June 12, 2026 22:34
@github-actions github-actions Bot added the area-Documentation Related to the documentation, including the repository onboarding experience label Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Documentation Related to the documentation, including the repository onboarding experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants