-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Open
Labels
enhancementNew feature or requestNew feature or request
Description
🌟 Feature Description
Could we add a CI job for automated lint fixing?
Motivation
This would enable automatic lint checking and fixing within our CI pipeline, saving manual effort and freeing up developers' time.
sample code:
name: Lint Fix
on:
pull_request:
branches:
- main
jobs:
lint-fix:
name: Fix linting issues
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
... ...
- name: run format
run:
make format
# Commit and push changes if any
- name: Check for changes
id: git-check
run: |
git diff --quiet || echo "changes=true" >> $GITHUB_OUTPUT
- name: Commit and push if there are changes
if: steps.git-check.outputs.changes == 'true'
run: |
git config --local user.email "XXX"
git config --local user.name "XXX"
git commit -a -m "🤖 Auto-fix linting issues"
git push
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request