Fix update_project to use custom GitHub token for cross-org project access#13276
Merged
Fix update_project to use custom GitHub token for cross-org project access#13276
Conversation
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
mnkiefer
approved these changes
Feb 2, 2026
Contributor
|
@copilot Recompile workflows |
Copilot
AI
changed the title
[WIP] Fix project access issue in draft issue update
Fix update_project to use custom GitHub token for cross-org project access
Feb 2, 2026
Contributor
Author
Workflows recompiled successfully. All 149 workflow files compiled with no changes to commit - the .lock.yml files are already up to date with the JavaScript handler changes. |
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.
The
update_projecthandler fails when accessing Projects v2 in organizations different from the repository, throwing "Project not found or not accessible" despite a custom token being configured insafe-outputs.update-project.github-token.Root cause
The handler's
main()function doesn't accept thegithubClientparameter passed by the unified handler manager. It always uses the globalgithubobject (default GITHUB_TOKEN), which lacks cross-org project permissions.Other project handlers (
create_project,create_project_status_update) already implement this pattern correctly.Changes
Updated function signatures to accept GitHub client:
main(config, githubClient)- Factory functionupdateProject(output, temporaryIdMap, githubClient)- Main handlerresolveProjectV2(projectInfo, projectNumberInt, github)- Project resolverlistAccessibleProjectsV2(projectInfo, github)- Project listerPattern applied:
All functions fall back to
global.githubfor backward compatibility. Existing tests pass without modification.Impact
Workflows with custom project tokens now work across organization boundaries:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.