Skip to content

Commit

Permalink
Add code formatting to the CI pipeline
Browse files Browse the repository at this point in the history
Any PR will now have code formatting automatically applied.
  • Loading branch information
evmaki authored Oct 23, 2024
1 parent 021e394 commit e15a965
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Code formatter for PRs
on: pull_request
jobs:
format-code:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
# Update output format to enable automatic inline annotations.
- name: Run Ruff
run: ruff format
- name: Commit formatting changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply code formatting
branch: ${{ github.head_ref }}

0 comments on commit e15a965

Please sign in to comment.