diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml new file mode 100644 index 0000000000..161ffdbb3f --- /dev/null +++ b/.github/workflows/pre-commit.yaml @@ -0,0 +1,36 @@ +# Until Dependabot support is released https://github.com/dependabot/dependabot-core/issues/1524 +name: Pre-commit update + +on: + # every week on monday + schedule: + - cron: "0 0 * * 1" + workflow_dispatch: + +permissions: + pull-requests: write + +jobs: + upgrade: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Run autoupdate + run: | + pre-commit autoupdate + + - name: Commit and push + run: | + git add ".pre-commit-config.yaml" + git commit -m "Upgrade pre-commit dependencies" + git push origin upgrade/pre-commit + + - name: Open pull request + run: | + gh pr create --fill