Skip to content

Sync Dependabot action pin comments via reusable workflow - #459

Merged
jeremy merged 3 commits into
mainfrom
ci/dependabot-sync-caller
Jul 27, 2026
Merged

Sync Dependabot action pin comments via reusable workflow#459
jeremy merged 3 commits into
mainfrom
ci/dependabot-sync-caller

Conversation

@jeremy

@jeremy jeremy commented Jul 27, 2026

Copy link
Copy Markdown
Member

Thin caller for the dependabot-sync-actions-comments reusable workflow (basecamp/.github#8, merged as 95a9f7a2). After CI completes on a Dependabot github_actions branch, trusted default-branch code fixes any stale # vX.Y.Z pin comments — including compound ones with trailing # zizmor: ignore[...] annotations that Dependabot can't rewrite — and pushes back behind a compare-and-swap lease.

This is the automation that was withdrawn from #458 after review: the push-triggered lineage executed the freshly-bumped (unreviewed) checkout action with a write token, and GITHUB_TOKEN can't push workflow-file changes at all (openclaw-basecamp@54c96d3e). The reusable model runs only reviewed default-branch code, fetches the Dependabot head branch as data, and pushes with a write deploy key scoped to this repo's dependabot-sync environment (deployment branches: main only). Environment + deploy key are already provisioned.

#458 (comment fix + ignore restructure) remains complementary: bare version comments there let Dependabot itself maintain them as the first line of defense; this workflow is the backstop that catches what Dependabot can't rewrite.

Runtime validation: after merge, a workflow_dispatch run against a live Dependabot actions branch (basecamp-cli#566 is the standing candidate for the fleet) proves the full fix→guard→push→re-CI loop.

Sibling callers: basecamp-cli#572, hey-cli#141, fizzy-cli#189, cli#51.


Summary by cubic

Adds a thin GitHub Actions caller for the reusable dependabot-sync-actions-comments to fix stale # vX.Y.Z pin comments on dependabot/github_actions/* branches after CI, then push via the repo’s dependabot-sync environment deploy key. Runs reviewed default-branch code only; the reusable workflow is re-pinned to the version that removed the CI-dispatch fallback and now verifies CI started on the pushed head.

  • New Features
    • Triggers on workflow_run of Test and manual workflow_dispatch (branch, e2e), and filters workflow_run to dependabot/github_actions/** at the trigger (job-level guard remains).
    • Uses a SHA-pinned reusable workflow that fetches the Dependabot branch as data, rewrites pin comments (including # zizmor: ignore[...]), guards pushes with a compare-and-swap lease, and verifies CI started on the pushed head instead of dispatching a fallback.
    • Minimal permissions; secrets: inherit enables the environment-scoped deploy key to push.

Written for commit e4acea2. Summary will update on new commits.

Review in cubic

Thin caller for basecamp/.github's dependabot-sync-actions-comments
reusable workflow (basecamp/.github#8): after CI completes on a
Dependabot github_actions branch, trusted default-branch code fixes any
stale pin version comments and pushes back behind a compare-and-swap
lease, using the write deploy key scoped to this repo's dependabot-sync
environment (deployment branches: main only).

Replaces the push-triggered port withdrawn from #458: that lineage
executed the freshly-bumped unreviewed checkout action with a write
token, and GITHUB_TOKEN cannot push workflow-file changes at all.
Copilot AI review requested due to automatic review settings July 27, 2026 20:08
@github-actions github-actions Bot added the github-actions Pull requests that update GitHub Actions label Jul 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Sensitive Change Detection (shadow mode)

This PR modifies control-plane files:

  • .github/workflows/dependabot-sync-actions-comments.yml

Shadow mode — this check is informational only. When activated, changes to these paths will require approval from a maintainer.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a thin GitHub Actions workflow in this repo that delegates to the SHA-pinned basecamp/.github reusable workflow to keep Dependabot github_actions pin comments (# vX.Y.Z) in sync by running trusted default-branch code and pushing fixes back with an environment-scoped deploy key.

Changes:

  • Introduces .github/workflows/dependabot-sync-actions-comments.yml as a caller for the basecamp/.github reusable workflow.
  • Triggers on workflow_run for the repo’s Test workflow (plus workflow_dispatch for manual runs) and forwards required inputs/permissions/secrets.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/dependabot-sync-actions-comments.yml

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 1 file

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread .github/workflows/dependabot-sync-actions-comments.yml
Review feedback: the job-level if only skips the job after the run is
created; a trigger-level branches filter stops runs from being created
for non-Dependabot branches at all. The if stays as defense-in-depth.
Copilot AI review requested due to automatic review settings July 27, 2026 20:19
@github-actions github-actions Bot added the enhancement New feature or request label Jul 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

.github/workflows/dependabot-sync-actions-comments.yml:35

  • The job-level guard only checks head_branch for workflow_run events, so any non-PR Test run on a Dependabot branch (manual dispatch, rerun by a human, etc.) will still invoke the reusable workflow and then get skipped internally. Tighten this if: to match the reusable workflow’s gating (workflow_run.event == 'pull_request' and actor.login == 'dependabot[bot]') to avoid unnecessary reusable-workflow executions and reduce Actions noise.
    if: >-
      github.event_name == 'workflow_dispatch' ||
      startsWith(github.event.workflow_run.head_branch, 'dependabot/github_actions/')

Comment thread .github/workflows/dependabot-sync-actions-comments.yml
basecamp/.github#10 removed the CI-dispatch fallback (Codex P1 on
fizzy-cli#189: dispatching branch workflows executes unreviewed action
pins outside the Dependabot sandbox); the workflow now verifies CI
started on the pushed head and warns a maintainer if not.
Copilot AI review requested due to automatic review settings July 27, 2026 20:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@jeremy
jeremy merged commit c68c3dd into main Jul 27, 2026
48 checks passed
@jeremy
jeremy deleted the ci/dependabot-sync-caller branch July 27, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request github-actions Pull requests that update GitHub Actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants