Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/fullsend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ jobs:
&& 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')
&& (
endsWith(github.event.pull_request.user.login, '[bot]')
|| contains(github.event.pull_request.labels.*.name, 'fullsend-fix')
)
steps:
- name: Build minimal payload
id: payload
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/reusable-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
TRIGGERING_LABEL: ${{ github.event.label.name }}
PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
PR_BASE_REPO: ${{ github.event.pull_request.base.repo.full_name }}
PR_USER_LOGIN: ${{ github.event.pull_request.user.login }}
ORG_NAME: ${{ github.repository_owner }}
run: |
set -euo pipefail
Expand Down Expand Up @@ -185,8 +186,10 @@ jobs:
if [[ -n "${PR_HEAD_REPO}" && -n "${PR_BASE_REPO}" ]]; then
if [[ "${PR_HEAD_REPO}" == "${PR_BASE_REPO}" ]]; then
if ! has_label "fullsend-no-fix" "${PR_LABELS}"; then
STAGE="fix"
TRIGGER_SOURCE="${REVIEW_USER_LOGIN}"
if [[ "${PR_USER_LOGIN}" =~ \[bot\]$ ]] || has_label "fullsend-fix" "${PR_LABELS}"; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[minor] The /fix slash command path (~line 128) intentionally bypasses this gate — authorized users can trigger fix without the fullsend-fix label. A brief comment here noting that distinction would help future maintainers. (Noted, deferring.)

STAGE="fix"
TRIGGER_SOURCE="${REVIEW_USER_LOGIN}"
fi
fi
fi
fi
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/reusable-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,20 +238,32 @@ jobs:
echo "Fix iteration: ${ITERATION} (${FIX_COMMITS} previous fix commits)" >&2
echo "iteration=${ITERATION}" >> "${GITHUB_OUTPUT}"

- name: Check fullsend-no-fix label
- name: Check fix eligibility
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
TRIGGER_SOURCE: ${{ inputs.trigger_source }}
PR_NUM: ${{ steps.context.outputs.pr_number }}
SOURCE_REPO: ${{ inputs.source_repo }}
run: |
if [[ "${TRIGGER_SOURCE}" =~ \[bot\]$ ]]; then
HAS_NO_FIX=$(gh pr view "${PR_NUM}" --repo "${SOURCE_REPO}" \
--json labels --jq '[.labels[].name] | any(. == "fullsend-no-fix")' 2>/dev/null || echo "false")
PR_INFO=$(gh pr view "${PR_NUM}" --repo "${SOURCE_REPO}" \
--json labels,author --jq '{labels: [.labels[].name], author: .author.login}' 2>/dev/null \
|| echo '{"labels":[],"author":""}')

HAS_NO_FIX=$(echo "${PR_INFO}" | jq -r '.labels | any(. == "fullsend-no-fix")')
if [[ "${HAS_NO_FIX}" == "true" ]]; then
echo "::warning::PR #${PR_NUM} has 'fullsend-no-fix' label — skipping bot-triggered fix"
exit 1
fi

PR_AUTHOR=$(echo "${PR_INFO}" | jq -r '.author')
if [[ ! "${PR_AUTHOR}" =~ \[bot\]$ ]]; then
HAS_FIX_LABEL=$(echo "${PR_INFO}" | jq -r '.labels | any(. == "fullsend-fix")')
if [[ "${HAS_FIX_LABEL}" != "true" ]]; then
echo "::warning::Human-authored PR #${PR_NUM} without 'fullsend-fix' label — skipping bot-triggered fix"
exit 1
fi
fi
fi

- name: Checkout target repository at PR HEAD
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# lint-workflow-size: max-lines=380
# lint-workflow-size: max-lines=385
# Dispatcher workflow that routes events to agent workflows based on stage.
# Routing logic determines the stage from event context — the shim only
# forwards the raw event. Adding a new stage requires only a case branch
Expand Down Expand Up @@ -41,6 +41,7 @@ jobs:
TRIGGERING_LABEL: ${{ github.event.label.name }}
PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
PR_BASE_REPO: ${{ github.event.pull_request.base.repo.full_name }}
PR_USER_LOGIN: ${{ github.event.pull_request.user.login }}
ORG_NAME: ${{ github.repository_owner }}
run: |
set -euo pipefail
Expand Down Expand Up @@ -165,8 +166,10 @@ jobs:
# Check no-fix label (use PR_LABELS — issue.labels is empty
# on pull_request_review events)
if ! has_label "fullsend-no-fix" "${PR_LABELS}"; then
STAGE="fix"
TRIGGER_SOURCE="${REVIEW_USER_LOGIN}"
if [[ "${PR_USER_LOGIN}" =~ \[bot\]$ ]] || has_label "fullsend-fix" "${PR_LABELS}"; then
STAGE="fix"
TRIGGER_SOURCE="${REVIEW_USER_LOGIN}"
fi
fi
fi
fi
Expand Down
Loading