fix(workflow): assign Copilot via GraphQL replaceActorsForAssignable#19
Merged
fix(workflow): assign Copilot via GraphQL replaceActorsForAssignable#19
Conversation
The previous Sync from Docs workflow has been failing with HTTP 422 since
it tried to create issues with two invalid REST fields:
- agent_assignment: {...} (not a valid Issues API field)
- assignees: ["copilot-swe-agent[bot]"] (not a valid assignee login)
This rewrites the issue-creation step to:
1. Create a plain issue (title/body/labels only)
2. Look up the Copilot bot id via GraphQL suggestedActors
3. Assign Copilot via GraphQL replaceActorsForAssignable
ADMIN_GITHUB_TOKEN must belong to a user with a Copilot seat for the
assignment to succeed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Sync from Docs workflow has been failing with HTTP 422 every time Docs pushes:
agent_assignment(not a valid Issues REST field).copilot-swe-agent[bot](not a valid assignee login).GitHub silently swallows invalid bot assignees on the REST endpoint, but the bogus
agent_assignmentfield triggers a hard 422.What
agent_assignmentfrom the create-issue payload.suggestedActors(capabilities: [CAN_BE_ASSIGNED]), then assign viareplaceActorsForAssignable.ADMIN_GITHUB_TOKEN(must belong to a user with a Copilot seat) for assignment.Verification
A local dry run with the admin token successfully:
suggestedActors(logincopilot-swe-agent),Copilot connectedevent indicating the agent session started.Closes the regression that has blocked auto-sync since April.