diff --git a/.github/workflows/dependabot-prek.yaml b/.github/workflows/dependabot-prek.yaml deleted file mode 100644 index b6730336..00000000 --- a/.github/workflows/dependabot-prek.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: Dependabot `prek auto-update` - -on: - push: - branches: - - "dependabot/github_actions/**" - -jobs: - prek-auto-update: - # Only run on dependabot PRs - if: github.actor == 'dependabot[bot]' - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - ref: ${{ github.head_ref }} - token: ${{ secrets.PUSH_TOKEN }} - - uses: taiki-e/install-action@e49978b799e49ff429d162b7a30601a569ab6538 # v2.81.1 - with: - tool: prek - - run: prek auto-update - - - name: Commit changes - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - - if [[ -n $(git status --porcelain) ]]; then - git add -A - git commit -m $'`prek auto-update`\n\n[dependabot skip]' - git push - fi diff --git a/.github/workflows/prek-auto-update.yaml b/.github/workflows/prek-auto-update.yaml new file mode 100644 index 00000000..ecf9e17f --- /dev/null +++ b/.github/workflows/prek-auto-update.yaml @@ -0,0 +1,24 @@ +name: prek auto-update + +on: + schedule: + - cron: "0 12 * * 5" # Every Friday at 12:00 UTC (5am PDT / 4am PST). + workflow_dispatch: + +permissions: {} + +jobs: + prek-auto-update: + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: write # Change files + pull-requests: write # Create and update PRs + steps: + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + with: + # zizmor: ignore[artipacked] no archive; needed for git + persist-credentials: true + - uses: danielparks/github-actions/prek-auto-update@2f6c98c73f0a8130d737500b59a0fddf749b484d # v1.1.1 + with: + token: ${{ secrets.AUTO_UPDATE_TOKEN }}