From 69fc2caa31546928a2c1550701cfc9002f6edf2d Mon Sep 17 00:00:00 2001 From: Zanie Date: Wed, 1 Nov 2023 12:06:14 -0500 Subject: [PATCH] Add CI job to auto-update pre-commit dependencies weekly --- .github/workflows/pre-commit.yaml | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/pre-commit.yaml 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