diff --git a/.github/workflows/bot.yaml b/.github/workflows/bot.yaml index b6c2784..7a612f6 100644 --- a/.github/workflows/bot.yaml +++ b/.github/workflows/bot.yaml @@ -1,4 +1,4 @@ -name: autofix.ci +name: bot concurrency: group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }} cancel-in-progress: true @@ -14,32 +14,30 @@ permissions: jobs: uv-lock: + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} runs-on: ubuntu-latest + name: uv lock --upgrade steps: + - uses: actions/create-github-app-token@v2 + id: app-token + with: + app-id: ${{ secrets.UV_LOCK_UPGRADER_APP_ID }} + private-key: ${{ secrets.UV_LOCK_UPGRADER_APP_PRIVATE_KEY }} - uses: actions/checkout@v4 - uses: astral-sh/setup-uv@v6 - run: uv lock --upgrade - - uses: autofix-ci/action@v1.3.2 - if: ${{ github.event_name == 'pull_request' }} - uses: peter-evans/create-pull-request@v7 with: + token: ${{ steps.app-token.outputs.token }} commit-message: "chore: upgrade uv.lock" title: "chore: upgrade uv.lock" body: This PR updates the uv.lock file with the latest dependency versions. branch: update-uv-lock delete-branch: true - if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} - id: pr - - name: Enable auto-merge for the PR - if: ${{ steps.pr.outputs.pull-request-number }} - run: gh pr merge --auto --squash "${{ steps.pr.outputs.pull-request-number }}" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} auto-merge: - needs: uv-lock + if: ${{ github.event_name == 'pull_request' && (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]' || github.event.pull_request.user.login == 'github-actions[bot]') }} runs-on: ubuntu-latest - if: ${{ github.event_name == 'pull_request' && (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]') }} steps: - name: Enable auto-merge for bot PRs run: gh pr merge --auto --squash "$PR_URL" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2ca13b0..e81419f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,8 @@ -ci: - skip: [uv-lock] - repos: - repo: https://github.com/astral-sh/uv-pre-commit rev: 0.7.12 hooks: - id: uv-lock - args: [--upgrade] - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.11.13