diff --git a/.github/workflows/fullsend.yaml b/.github/workflows/fullsend.yaml index f7b41e4..92d8fc1 100644 --- a/.github/workflows/fullsend.yaml +++ b/.github/workflows/fullsend.yaml @@ -17,6 +17,10 @@ # Only the fields consumed by downstream workflows are dispatched. The full # github.event can exceed GitHub's 65KB workflow_dispatch input limit on # large dependency-update PRs (Renovate/Mintmaker bodies alone can be ~38KB). +# +# Command matching: exact, space-delimited args, or newline-delimited body. +# fromJSON('"\n"') produces a literal newline (GHA strings lack escape support). +# Assumes LF line endings; GitHub's web UI normalizes to LF (CRLF only via API). name: fullsend permissions: @@ -42,6 +46,7 @@ jobs: github.event_name == 'issue_comment' && ( github.event.comment.body == '/triage' || startsWith(github.event.comment.body, '/triage ') || + startsWith(github.event.comment.body, format('{0}{1}', '/triage', fromJSON('"\n"'))) || ( (github.event.comment.author_association != 'NONE' || github.event.comment.user.login == github.event.issue.user.login) && @@ -87,7 +92,8 @@ jobs: && !github.event.issue.pull_request && ( github.event.comment.body == '/code' || - startsWith(github.event.comment.body, '/code ') + startsWith(github.event.comment.body, '/code ') || + startsWith(github.event.comment.body, format('{0}{1}', '/code', fromJSON('"\n"'))) )) steps: - name: Build minimal payload @@ -128,7 +134,8 @@ jobs: && github.event.label.name == 'ready-for-review') || (github.event_name == 'issue_comment' && ( github.event.comment.body == '/review' || - startsWith(github.event.comment.body, '/review ') + startsWith(github.event.comment.body, '/review ') || + startsWith(github.event.comment.body, format('{0}{1}', '/review', fromJSON('"\n"'))) )) || github.event_name == 'pull_request_target' steps: @@ -174,6 +181,7 @@ jobs: && github.event.review.state == 'changes_requested' && github.event.review.user.login == format('{0}-review[bot]', github.repository_owner) && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name + && !contains(github.event.pull_request.labels.*.name, 'fullsend-no-fix') steps: - name: Build minimal payload id: payload @@ -222,6 +230,7 @@ jobs: && ( github.event.comment.body == '/fix' || startsWith(github.event.comment.body, '/fix ') + || startsWith(github.event.comment.body, format('{0}{1}', '/fix', fromJSON('"\n"'))) ) && ( github.event.comment.author_association == 'OWNER' @@ -305,3 +314,36 @@ jobs: --field event_payload="$EVENT_PAYLOAD" \ --field classify_mode="single" \ --field issue_number="$ISSUE_NUMBER" + + dispatch-stop-fix: + runs-on: ubuntu-latest + if: >- + github.event_name == 'issue_comment' + && github.event.issue.pull_request + && github.event.comment.user.type != 'Bot' + && github.event.comment.body == '/stop-fix' + && ( + github.event.comment.author_association == 'OWNER' + || github.event.comment.author_association == 'MEMBER' + || github.event.comment.author_association == 'COLLABORATOR' + || github.event.comment.author_association == 'CONTRIBUTOR' + || github.event.comment.user.login == github.event.issue.user.login + ) + permissions: + contents: read + issues: write + pull-requests: write + steps: + - name: Add fullsend-no-fix label and notify + env: + GH_TOKEN: ${{ secrets.FULLSEND_DISPATCH_TOKEN }} + PR_NUMBER: ${{ github.event.issue.number }} + REPO: ${{ github.repository }} + run: | + gh label create "fullsend-no-fix" --repo "$REPO" \ + --description "Skip bot-triggered fix agent runs" --color "FBCA04" \ + --force 2>/dev/null || true + gh pr edit "$PR_NUMBER" --repo "$REPO" \ + --add-label "fullsend-no-fix" + gh pr comment "$PR_NUMBER" --repo "$REPO" \ + --body "Fix agent disabled for this PR. Remove the \`fullsend-no-fix\` label or use \`/fix\` to re-engage."