ci: automate pre-commit autofix workflow and add codeowners#188
Merged
Conversation
**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
**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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Key Changes:
Added:
.github/CODEOWNERSfile to ensure all workflow and CI configuration changes require review by @l50.github/workflows/pre-commit.yamlto detect, capture, and upload pre-commit autofix patches when availableautocommitjob to.github/workflows/pre-commit.yamlthat applies pre-commit autofixes and pushes changes to PRs created by the Renovate botChanged:
.github/workflows/pre-commit.yamlto output whether autofixes are available and adjusted checkout steps to use the correct ref and avoid persisting credentials