Update pre-commit config #45
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: "Update pre-commit config" | |
on: | |
schedule: | |
- cron: "0 7 * * 0" # At 07:00 on each Sunday. | |
workflow_dispatch: | |
jobs: | |
update-pre-commit: | |
if: github.repository_owner == 'svg153' | |
name: Autoupdate pre-commit config | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
- name: Cache multiple paths | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/pre-commit | |
~/.cache/pip | |
key: pre-commit-autoupdate-${{ runner.os }}-build | |
- name: Update pre-commit config packages | |
uses: technote-space/create-pr-action@v2 # https://github.com/technote-space/create-pr-action | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
EXECUTE_COMMANDS: | | |
pip install pre-commit | |
pre-commit autoupdate || (exit 0); | |
pre-commit run -a || (exit 0); | |
COMMIT_MESSAGE: "⬆️ UPGRADE: Autoupdate pre-commit config" | |
PR_BRANCH_NAME: "pre-commit-config-update-${PR_ID}" | |
PR_TITLE: "⬆️ UPGRADE: Autoupdate pre-commit config" | |
# https://sourcegraph.com/search?q=context:global+file:.github/workflows/+lang:YAML+uses:+technote-space/create-pr-action&patternType=literal | |
# https://sourcegraph.com/github.com/technote-space/get-diff-action/-/blob/.github/workflows/sync-workflows.yml?L17 |