Skip to content

Commit

Permalink
Merge branch 'main' into DonnieBLT/add-year-filter
Browse files Browse the repository at this point in the history
  • Loading branch information
DonnieBLT authored Nov 9, 2024
2 parents 31940e4 + 9c292d5 commit d9a2533
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/pre-commit-fix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

name: Run pre-commit and commit changes on Github Actions UI
on:
workflow_dispatch:
permissions:
contents: write
jobs:
run-pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install pre-commit
run: |
python -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install pre-commit
- name: Run pre-commit
run: |
. venv/bin/activate
pre-commit run --all-files
continue-on-error: true
- name: Check for changes
id: check_changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Changes detected by pre-commit."
echo "::set-output name=changes_detected::true"
else
echo "No changes made by pre-commit."
echo "::set-output name=changes_detected::false"
fi
- name: Commit and push changes
if: steps.check_changes.outputs.changes_detected == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Apply pre-commit fixes"
git push origin HEAD:${{ github.ref_name }}

0 comments on commit d9a2533

Please sign in to comment.