Skip to content

H-6402: Add preflight reusable workflows#35

Merged
TimDiekmann merged 12 commits intomainfrom
t/h-6402-move-dismiss-stale-approvals-workflow-to-github-org-repo
Apr 1, 2026
Merged

H-6402: Add preflight reusable workflows#35
TimDiekmann merged 12 commits intomainfrom
t/h-6402-move-dismiss-stale-approvals-workflow-to-github-org-repo

Conversation

@TimDiekmann
Copy link
Copy Markdown
Member

@TimDiekmann TimDiekmann commented Mar 31, 2026

Summary

  • Adds dismiss-stale-approvals composite action and reusable workflow (moved from hash repo)
  • Adds todo-comments reusable workflow (scans for TODO comments referencing Linear tickets)
  • Renames dependency-review.yml to dependencies.yml for consistent naming
  • Uses OIDC token (job_workflow_ref) to resolve the correct checkout ref for the composite action — no input parameter needed, Renovate-compatible
  • Applies Preflight / <topic> / <action> naming convention for clean check display in callers

Check naming convention

Callers add a preflight.yml workflow that calls these reusable workflows:

  • Preflight / Stale approvals / Dismiss
  • Preflight / Dependencies / Review
  • Preflight / Todo comments / Scan

OIDC workaround

Reusable workflows can't determine their own ref (all github.* context refers to the caller). We extract job_workflow_ref from the OIDC token to get the correct SHA for checking out the composite action. This will be replaced by the $/ syntax once available:
https://github.com/orgs/community/discussions/26245#discussioncomment-15601440

Move the dismiss-stale-approvals composite action and workflow from
the hash repo to the .github org repo. Uses github.workflow_sha to
ensure action code matches the workflow version callers pin to.
Runs self-test and dry-run on pull_request events.
@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 31, 2026

🤖 Augment PR Summary

Summary: Adds automation in this org repo to detect and dismiss stale PR approvals (plus a TODO/ticket scan workflow), consolidating CI logic that previously lived elsewhere.

Changes:

  • Introduces a composite action .github/actions/dismiss-stale-approvals that:
    • Persists prior base/head SHAs via an uploaded artifact
    • Uses git range-diff to detect effective diff changes between runs
    • Finds the latest approval commit SHA and checks for post-approval manual conflict resolutions
    • Dismisses approved reviews (or comments instead when dry-run is enabled)
  • Adds a reusable workflow .github/workflows/dismiss-stale-approvals.yml that checks out the action from the same ref (OIDC-derived) and runs a self-test on direct PR changes to the workflow/action.
  • Adds .github/workflows/todo-comments.yml to fail PRs when TODOs/Linear URLs reference ticket IDs present in the PR title.
  • Renames the dependency review workflow file to dependencies.yml and adjusts the job naming.

Technical Notes: External actions are pinned by SHA; the stale-approval workflow uses an OIDC token claim to determine the ref for checking out the action code.

🤖 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. 4 suggestions posted.

Fix All in Augment

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

@TimDiekmann TimDiekmann marked this pull request as draft March 31, 2026 17:50
@TimDiekmann
Copy link
Copy Markdown
Member Author

Too much AI noise

Rename workflow/job names for clean check display:
- Workflow name = topic (shown in .github repo Actions tab)
- Job name = action verb (shown as segment 3 in caller checks)

Schema: Preflight / <topic> / <action>
- Rename dependency-review.yml to dependencies.yml (consistent naming)
- Add todo-comments.yml: scans for TODO comments referencing Linear
  ticket IDs from the PR title
@TimDiekmann TimDiekmann marked this pull request as ready for review March 31, 2026 23:14
@TimDiekmann TimDiekmann changed the title H-6402: Add dismiss-stale-approvals reusable workflow and action H-6402: Add preflight reusable workflows Mar 31, 2026
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. 2 suggestions posted.

Fix All in Augment

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

@TimDiekmann TimDiekmann merged commit 52c4a1f into main Apr 1, 2026
7 checks passed
@TimDiekmann TimDiekmann deleted the t/h-6402-move-dismiss-stale-approvals-workflow-to-github-org-repo branch April 1, 2026 09:33
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