Skip to content

Auto-enable PR auto-merge in weekly-audit workflow#52

Merged
wnstfy merged 1 commit into
mainfrom
chore/audit-auto-merge
May 25, 2026
Merged

Auto-enable PR auto-merge in weekly-audit workflow#52
wnstfy merged 1 commit into
mainfrom
chore/audit-auto-merge

Conversation

@wnstfy

@wnstfy wnstfy commented May 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds id: audit_pr to the peter-evans/create-pull-request step in weekly-audit.yml.
  • Adds a follow-up step that calls gh pr merge --auto --squash --delete-branch against the newly-created/updated audit PR, so GitHub's auto-merge daemon takes over once hermes' approval and required checks land.
  • Gated on pull-request-operation == 'created' || 'updated' so no-op runs don't trigger.

Why

Today's PR #51 required manual "Enable auto-merge" clicks (after the enterprise/org/repo permission cascade was sorted). With this change, the weekly audit is end-to-end hands-off: cron → scan → delta → PR → hermes review → auto-merge. Maintainer involvement remains for the case where hermes flags a regression (it posts a --comment review then, which doesn't satisfy the count gate, so auto-merge stays paused for human eyes).

Risk

Low. If anything goes wrong with auto-merge enablement, the PR stays open and the maintainer can merge by hand — same as the pre-change behaviour. No effect on the scan/delta logic itself.

Test plan

  • actionlint + yamllint pass against the modified file.
  • Verify on the next weekly audit cycle (Monday 06:00 UTC) — confirm the new step runs without error and that the audit PR comes up with auto-merge already enabled.

The weekly-audit workflow opens a PR when a CVE delta is detected, but
prior to this change the maintainer had to manually click "Merge" or
"Enable auto-merge" for every audit PR.

Add a follow-up step that calls `gh pr merge --auto --squash` against
the PR just created/updated, so the GitHub auto-merge daemon picks it up
the moment hermes' approval and required checks are in. Maintainer
involvement is now only required when hermes flags a regression.

Gated on `pull-request-operation` being created/updated to avoid firing
on no-op runs.
@github-actions

Copy link
Copy Markdown
Contributor

Trivy misconfiguration findings (HIGH + CRITICAL)

✅ No HIGH or CRITICAL misconfigurations detected.

@wn-hermes wn-hermes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Workflow change review

Files changed: .github/workflows/weekly-audit.yml only.

What this does

Adds an id: audit_pr handle to the existing peter-evans/create-pull-request audit PR step, then uses that step's outputs to enable GitHub auto-merge on the created or updated audit PR with gh pr merge --auto --squash --delete-branch.

Verification

  • Diff matches description: yes — only the step id and the new auto-merge enablement step were added.
  • Any hidden changes: no — only .github/workflows/weekly-audit.yml changed, with 10 added lines and no deletions.
  • Token/permission/secret implications: no secret values exposed; the new step uses the workflow GITHUB_TOKEN via GH_TOKEN, and the diff does not alter the existing permissions block.

Verdict

Looks safe as a one-off workflow change; the if: gate correctly limits auto-merge enablement to created or updated audit PRs.

@wnstfy
wnstfy merged commit f946fb7 into main May 25, 2026
5 checks passed
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