Skip to content

SRE 696: Fix stale approvals reusable workflow checkout for PR callers#62

Closed
lunelson wants to merge 1 commit into
hashintel:mainfrom
lunelson:ln/sre-696-fix-stale-approvals-checkout-source
Closed

SRE 696: Fix stale approvals reusable workflow checkout for PR callers#62
lunelson wants to merge 1 commit into
hashintel:mainfrom
lunelson:ln/sre-696-fix-stale-approvals-checkout-source

Conversation

@lunelson
Copy link
Copy Markdown
Collaborator

@lunelson lunelson commented May 19, 2026

Summary

  • Always checkout the shared action from hashintel/.github instead of the PR head repository
  • Remove the split checkout path added in Avoid dismissing approvals on restacks alone #58 for pull_request events
  • Use the reusable workflow ref when it can be resolved, with main as the pull_request fallback

Why

PR #58 made pull_request events checkout the PR head repository so changes to .github/actions/dismiss-stale-approvals could be self-tested before merge. That breaks callers in other repositories because their PR head checkout does not contain .github/actions/dismiss-stale-approvals/self-test.sh.

The reusable workflow should run the actual shared action from hashintel/.github regardless of which repository triggered the PR event.

Linear

  • SRE-696

Tests

  • .github/actions/dismiss-stale-approvals/self-test.sh

@cursor
Copy link
Copy Markdown

cursor Bot commented May 19, 2026

PR Summary

Low Risk
Low risk workflow-only change, but it can affect CI behavior by changing which repository/ref is checked out for the stale-approvals action (with a fallback to main).

Overview
Ensures the stale-approvals reusable workflow always checks out .github/actions/dismiss-stale-approvals from hashintel/.github (instead of conditionally checking out a PR head repo), so the action and self-test.sh are available for PR callers in other repositories.

Adds a fallback checkout ref of main when the reusable workflow ref cannot be resolved (e.g., pull_request events), while keeping the OIDC-based ref resolution for non-pull_request events.

Reviewed by Cursor Bugbot for commit ffd712f. Bugbot is set up for automated code reviews on this repo. Configure here.

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 19, 2026

🤖 Augment PR Summary

Summary: Updates the preflight-stale-approvals reusable workflow to only check out the PR head when the caller repo is hashintel/.github; other PR callers now check out hashintel/.github at the reusable workflow ref.
Why: Preserves action self-testing for .github PRs while preventing external repos from missing the shared action/self-test files.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@TimDiekmann TimDiekmann self-requested a review May 19, 2026 17:00
@lunelson lunelson force-pushed the ln/sre-696-fix-stale-approvals-checkout-source branch from 2d0d442 to ffd712f Compare May 19, 2026 17:23
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ffd712f. Configure here.

with:
repository: hashintel/.github
ref: ${{ steps.workflow-ref.outputs.ref }}
ref: ${{ steps.workflow-ref.outputs.ref || 'main' }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checkout uses main on pull_request

Medium Severity

On every pull_request run (including reusable workflows invoked from another repo’s PR), Resolve reusable workflow ref is skipped and checkout uses main on hashintel/.github. Callers pinned to another ref no longer get that ref, and hashintel/.github PRs no longer exercise the PR’s action changes.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ffd712f. Configure here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we don't make the workflow-ref job conditional, we can use the output all the time I think. It should work all the time.

@lunelson
Copy link
Copy Markdown
Collaborator Author

Superseded by #63, which uses an origin branch now that I have access to push to hashintel/.github.

@lunelson lunelson closed this May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants