Update a_pre_commit.yml #291
This file contains 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
name: Pre-commit | |
on: | |
pull_request_target: | |
push: | |
branches: [main] | |
# pull_request: | |
# types: [opened, reopened] | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
update: | |
# if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
with: | |
token: ${{ secrets.TOKEN }} | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: | | |
3.11 | |
- name: Install Dependencies | |
run: | | |
pip install pre-commit==3.6.0 ruff==0.2.0 | |
ruff check --fix --unsafe-fixes --config=pyproject.toml . | |
- name: Run pre-commit autoupdate | |
run: | | |
git config --global user.email "GitHub Action <[email protected]>" | |
git config --global user.name "GitHub Action <[email protected]>" | |
pre-commit autoupdate | |
pre-commit install -c .pre-commit-config.yaml || true | |
pre-commit run -c .pre-commit-config.yaml || true | |
git add -A | |
git commit -m ":rainbow: pre-commit | |
> Made via .github/workflows/a_pre_commit.yml" || echo "pre-commit: no changes" | |
# - name: Pre-commit and auto commit | |
# run: | | |
# pre-commit run --all-files || true | |
- name: Create Pull Request | |
uses: peter-evans/[email protected] | |
with: | |
token: ${{ secrets.TOKEN }} | |
commit-message: Update files | |
committer: GitHub Action <[email protected]> | |
author: GitHub Action <[email protected]> | |
signoff: true | |
branch: pre-commit | |
base: pre-commit | |
# base: main | |
title: "🔨 Update files by <github-actions[bot]>" | |
body: | | |
Auto-generated by [create-pull-request][1] | |
[1]: https://github.com/peter-evans/create-pull-request | |
labels: | | |
wait | |
in progress | |
bot | |
draft: false | |
delete-branch: true |