diff --git a/.github/workflows/dotbot-act.yml b/.github/workflows/dotbot-act.yml index 70982f8..4a59fd9 100644 --- a/.github/workflows/dotbot-act.yml +++ b/.github/workflows/dotbot-act.yml @@ -6,10 +6,6 @@ on: pull_request_review_comment: types: [created] -concurrency: - group: dotbot-act-${{ github.event.issue.number || github.event.pull_request.number || github.ref }} - cancel-in-progress: false - jobs: act: name: Act on /dotbot comments @@ -25,6 +21,15 @@ jobs: ) ) && github.actor != 'dependabot[bot]' + # Job-level, not workflow-level: every comment on the repo starts this + # workflow, and a workflow-level group is joined even when the job below is + # skipped. A skipped run would then cancel a waiting /dotbot run. A job + # skipped by `if:` never joins the group. queue: max keeps back-to-back + # /dotbot requests queued instead of dropping all but the newest. + concurrency: + group: dotbot-act-${{ github.event.issue.number || github.event.pull_request.number || github.ref }} + cancel-in-progress: false + queue: max runs-on: ubuntu-latest permissions: contents: write diff --git a/README.md b/README.md index a8e819b..abfb658 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ jobs: github_approval_token: ${{ secrets.DOTBOT_GITHUB_USER_PAT }} ``` + ### Automatic PR Approval If the `DOTBOT_GITHUB_USER_PAT` secret is set (passed via the @@ -70,9 +71,6 @@ permissions: workflows: write # needed if /dotbot may edit .github/workflows/* pull-requests: write issues: write -concurrency: - group: dotbot-act-${{ github.event.issue.number || github.event.pull_request.number || github.ref }} - cancel-in-progress: false jobs: act: name: Act on /dotbot comments @@ -88,6 +86,14 @@ jobs: ) ) && github.actor != 'dependabot[bot]' + # Job-level, not workflow-level: every comment starts this workflow, and a + # workflow-level group is joined even when the job is skipped, so an + # ordinary comment would cancel a waiting /dotbot run. queue: max keeps + # back-to-back /dotbot requests queued. + concurrency: + group: dotbot-act-${{ github.event.issue.number || github.event.pull_request.number || github.ref }} + cancel-in-progress: false + queue: max runs-on: ubuntu-latest steps: - uses: actions/checkout@v4