Repository navigation
fix: defense-in-depth against duplicate code agent PRs (#1312, #1320, #1321) #2373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
72f1848
095039e
9ea24e8
57e807c
de9e17a
cf544d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,7 +64,7 @@ jobs: | |
| contents: read | ||
| pull-requests: read | ||
| outputs: | ||
| stage: ${{ steps.role-check.outputs.skipped != 'true' && steps.route.outputs.stage || '' }} | ||
| stage: ${{ steps.role-check.outputs.skipped != 'true' && steps.pr-check.outputs.skipped != 'true' && steps.route.outputs.stage || '' }} | ||
|
jhutar marked this conversation as resolved.
Resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] logic-error When pr-check sets skipped=true, intermediate steps still run. Harmless read-only validations with minor inefficiency. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] fail-open The pr-check guard fails open on API errors. Intentional fail-open for defense-in-depth. |
||
| trigger_source: ${{ steps.route.outputs.trigger_source }} | ||
| event_payload: ${{ steps.payload.outputs.event_payload }} | ||
| steps: | ||
|
|
@@ -234,6 +234,27 @@ jobs: | |
| echo "stage=${STAGE}" >> "${GITHUB_OUTPUT}" | ||
| echo "trigger_source=${TRIGGER_SOURCE}" >> "${GITHUB_OUTPUT}" | ||
|
|
||
| - name: Check for existing PRs | ||
| id: pr-check | ||
| if: steps.route.outputs.stage == 'code' | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| ISSUE_NUMBER: ${{ github.event.issue.number }} | ||
| SOURCE_REPO: ${{ github.repository }} | ||
| run: | | ||
| set -euo pipefail | ||
| BOT_LOGIN="fullsend-ai[bot]" | ||
| CODER_BOT_LOGIN="fullsend-ai-coder[bot]" | ||
| MENTIONING_PRS="$(gh pr list --repo "${SOURCE_REPO}" --state open \ | ||
| --search "${ISSUE_NUMBER} in:title,body" \ | ||
|
jhutar marked this conversation as resolved.
Resolved
jhutar marked this conversation as resolved.
Resolved
|
||
| --json number,author \ | ||
| --jq "[.[] | select(.author.login != \"${BOT_LOGIN}\" and .author.login != \"${CODER_BOT_LOGIN}\")] | .[].number" \ | ||
| 2>/dev/null || true)" | ||
| if [[ -n "${MENTIONING_PRS}" ]]; then | ||
| echo "::notice::Open PR(s) mentioning issue #${ISSUE_NUMBER} found — skipping code dispatch" | ||
| echo "skipped=true" >> "${GITHUB_OUTPUT}" | ||
| fi | ||
|
|
||
| - name: Validate routed stage | ||
| if: steps.route.outputs.stage != '' | ||
| env: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.