Skip to content

ci: automate pre-commit autofix workflow and add codeowners#188

Merged
l50 merged 3 commits into
mainfrom
feat/pre-commit-autofix-bot-prs
May 10, 2026
Merged

ci: automate pre-commit autofix workflow and add codeowners#188
l50 merged 3 commits into
mainfrom
feat/pre-commit-autofix-bot-prs

Conversation

@l50
Copy link
Copy Markdown
Contributor

@l50 l50 commented May 10, 2026

Key Changes:

  • Introduced a CODEOWNERS file to require maintainer review for workflow changes
  • Enhanced pre-commit workflow to capture and upload autofix patches on failure
  • Added an autocommit job to automatically apply and push pre-commit autofixes for bot PRs

Added:

  • CODEOWNERS policy - Added .github/CODEOWNERS file to ensure all workflow and CI configuration changes require review by @l50
  • Autofix patch capture and upload - Implemented steps in .github/workflows/pre-commit.yaml to detect, capture, and upload pre-commit autofix patches when available
  • Automated autofix commit job - Added autocommit job to .github/workflows/pre-commit.yaml that applies pre-commit autofixes and pushes changes to PRs created by the Renovate bot

Changed:

  • Pre-commit job outputs - Updated pre-commit job in .github/workflows/pre-commit.yaml to output whether autofixes are available and adjusted checkout steps to use the correct ref and avoid persisting credentials

**Added:**

- Added step to generate a GitHub app token for autocommit on Renovate bot PRs
- Added logic to commit and push pre-commit autofixes back to the PR if pre-commit fails and files are modified
- Set up dynamic checkout and token usage to allow bot-authenticated pushes during CI

**Changed:**

- Updated permissions from `contents: read` to `contents: write` to allow commits
- Modified checkout step to use PR head ref and app token when available
@dreadnode-renovate-bot dreadnode-renovate-bot Bot added the area/github Changes made to github actions label May 10, 2026
l50 added 2 commits May 10, 2026 13:06
**Added:**

- Introduced CODEOWNERS file to require maintainer review for changes to .github/*
- Added dedicated autocommit job to apply pre-commit autofixes to Renovate bot PRs
- Implemented artifact upload and download for pre-commit autofix patch sharing between jobs

**Changed:**

- Updated permissions for pre-commit workflow jobs to use read-only access for contents
- Refactored checkout steps to avoid persisting credentials in both jobs
- Moved GitHub App token generation and usage to the autocommit job for better security
- Streamlined logic to detect and handle pre-commit autofixes using patch files and explicit outputs
- Improved clarity and reliability of conditionals for autofix application and artifact handling

**Removed:**

- Removed in-line autocommit logic from pre-commit job in favor of a separate autocommit job
- Eliminated unnecessary checkout token override and redundant status checks in pre-commit job
@l50 l50 changed the title ci: enable pre-commit autofix and bot commit workflow improvements ci: automate pre-commit autofix workflow and add codeowners May 10, 2026
@l50 l50 merged commit 9b54e5f into main May 10, 2026
9 checks passed
@l50 l50 deleted the feat/pre-commit-autofix-bot-prs branch May 10, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/github Changes made to github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant