ci(autofix): preserve issue assignment gates

This commit is contained in:
yiliang114 2026-07-10 00:12:43 +08:00
parent c9e36a11de
commit 0df4a1ffc7
2 changed files with 27 additions and 37 deletions

View file

@ -201,15 +201,9 @@ jobs:
fi
if [[ "${EVENT_NAME}" == 'issues' ]]; then
DO_REVIEW=false
# Assigned to the autofix bot → issue phase directly (bypasses
# label gates; the assignee itself is the trust signal).
if [[ "${ASSIGNEE_LOGIN}" == "${AUTOFIX_BOT}" && "${ISSUE_STATE}" == 'open' ]]; then
DO_ISSUE=true
ROUTE_ISSUE="${ISSUE_NUMBER}"
echo "🧭 issue #${ISSUE_NUMBER} assigned to ${AUTOFIX_BOT} → issue phase"
else
label_is_trigger=false
[[ "${ISSUE_LABEL}" == "${READY_FOR_AGENT_LABEL}" || "${ISSUE_LABEL}" == "${BUG_LABEL}" || "${ISSUE_LABEL}" == "${AUTOFIX_APPROVED_LABEL}" ]] && label_is_trigger=true
[[ "${ASSIGNEE_LOGIN}" == "${AUTOFIX_BOT}" ]] && label_is_trigger=true
if [[ "${label_is_trigger}" != 'true' ]]; then
echo "🧭 issue event ignored: trigger_label=false label='${ISSUE_LABEL:-n/a}' issue='#${ISSUE_NUMBER:-n/a}'"
else
@ -238,7 +232,6 @@ jobs:
fi
fi
fi
fi
;;
esac
# Forcing a specific issue/PR implies running that phase only for

View file

@ -304,12 +304,9 @@ describe('qwen-autofix workflow', () => {
'[[ "${ISSUE_LABEL}" == "${READY_FOR_AGENT_LABEL}" || "${ISSUE_LABEL}" == "${BUG_LABEL}" || "${ISSUE_LABEL}" == "${AUTOFIX_APPROVED_LABEL}" ]] && label_is_trigger=true',
);
expect(workflow).toContain(
'if [[ "${ASSIGNEE_LOGIN}" == "${AUTOFIX_BOT}" && "${ISSUE_STATE}" == \'open\' ]]; then',
);
expect(workflow).toContain('ROUTE_ISSUE="${ISSUE_NUMBER}"');
expect(workflow).toContain(
'issue #${ISSUE_NUMBER} assigned to ${AUTOFIX_BOT} → issue phase',
'[[ "${ASSIGNEE_LOGIN}" == "${AUTOFIX_BOT}" ]] && label_is_trigger=true',
);
expect(routeStep).not.toContain('ROUTE_ISSUE="${ISSUE_NUMBER}"');
expect(workflow).toContain(
'issue event ignored: state_open=$([[ "${ISSUE_STATE}" == \'open\' ]]',
);