Skip to content

Refine prek autoupdate cleanup schedule#423

Merged
Snuffy2 merged 7 commits into
custom-components:masterfrom
Snuffy2:Further-prek-autoupdate-refinement
Jun 2, 2026
Merged

Refine prek autoupdate cleanup schedule#423
Snuffy2 merged 7 commits into
custom-components:masterfrom
Snuffy2:Further-prek-autoupdate-refinement

Conversation

@Snuffy2

@Snuffy2 Snuffy2 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Refines the prek autoupdate workflow so hook updates still run weekly while cleanup runs every night.

The cleanup helper now removes stale generated branches more thoroughly while protecting branches used by open same-repo PRs.

What Changed

  • Changed the workflow schedule to run nightly, with the actual prek update job gated to Monday schedule runs or manual dispatch.
  • Added a nightly cleanup job that preserves the latest open generated prek update PR.
  • Extended the cleanup helper to enumerate matching branch refs and delete stale chore/prek-updates* branches.
  • Replaced fixed-branch cleanup with prefix-based stale branch cleanup.
  • Protected same-repo open PR head branches before deleting prefix-matched refs, so human or other bot PR branches are not deleted.
  • Added workflow/helper tests for daily cleanup, orphaned branch deletion, latest PR preservation, and non-workflow PR branch protection.

Why

The previous workflow only performed cleanup during weekly prek update runs. Running cleanup nightly keeps generated PR and branch clutter under control between weekly updates, while the extra branch protection avoids deleting branches still backing open PRs.

Related Issues

None.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Coverage report

This PR does not seem to contain any modification to coverable code.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e5320f20d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/prek_autoupdate.yml Outdated

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a3090a21c4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/scripts/cleanup_prek_update_branches.py Outdated
@Snuffy2
Snuffy2 merged commit ede65c6 into custom-components:master Jun 2, 2026
7 of 8 checks passed
@Snuffy2
Snuffy2 deleted the Further-prek-autoupdate-refinement branch June 2, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant