feat(update_project): add content-repo for cross-repo project item resolution#21387
feat(update_project): add content-repo for cross-repo project item resolution#21387
Conversation
…roject item resolution Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
There was a problem hiding this comment.
Pull request overview
Adds cross-repo support to update_project by allowing callers to specify the repository that owns the issue/PR being added/updated, instead of always using the workflow host repository.
Changes:
- Extend
update_projectschemas to accept optionalcontent_repo(owner/repo) for cross-repo item resolution. - Update
update_project.cjsto resolvecontent_numberagainstcontent_repowhen provided, with warning + fallback on invalid format. - Add tests for cross-repo issue/PR resolution and for
contentRepo→content_reponormalization.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
schemas/agent-output.json |
Adds content_repo to the update_project output schema. |
pkg/workflow/js/safe_outputs_tools.json |
Adds content_repo to the safe-outputs tool schema for update_project. |
actions/setup/js/safe_outputs_tools.json |
Mirrors the safe-outputs schema update for the action runtime copy. |
actions/setup/js/update_project.cjs |
Uses content_repo (when present) to resolve the GraphQL node ID for cross-repo issues/PRs; adds contentRepo alias normalization. |
actions/setup/js/update_project.test.cjs |
Adds coverage for cross-repo resolution and camelCase alias normalization. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
actions/setup/js/update_project.cjs
Outdated
| const parts = output.content_repo.split("/"); | ||
| if (parts.length === 2 && parts[0] && parts[1]) { | ||
| contentOwner = parts[0]; | ||
| contentRepo = parts[1]; | ||
| core.info(`Using content_repo for resolution: ${contentOwner}/${contentRepo}`); |
| } else { | ||
| core.warning(`Invalid content_repo format "${output.content_repo}": expected "owner/repo". Falling back to workflow host repository.`); | ||
| } |
|
@copilot make sure the field naming in the front matter uses dash not underscore (content-repo). Review comments. |
…idation, Go parser support, and agentic workflow test Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Addressed in commit ae6c1f5: Go parser — Added Compiler — Added Schema — Added JavaScript — Tests:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…d missing test for invalid format Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in ba434cb:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…-repo support only Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Done in 282c9a5. Reverted the Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
update_projecthardcodedcontext.repowhen resolvingcontent_numberto a GraphQL node ID, making it impossible to update project fields for items originating from other repositories — a common pattern for org-level projects aggregating issues across multiple repos.Changes
schemas/agent-output.json,safe_outputs_tools.json): Added optionalcontent_repofield ("owner/repo"format) toupdate_projectinput/output schemasupdate_project.cjs): Whencontent_repois present, uses it to resolvecontent_numberinstead ofcontext.repo; trims whitespace from the value and each part before use; warns and falls back tocontext.repoon invalid formatnormalizeUpdateProjectOutput()—contentRepo → content_repo(camelCase) andcontent-repo → content_repo(YAML dash-style) — so all three forms are accepted transparentlyUsage
The field accepts any of
content_repo,content-repo(YAML dash-style), orcontentRepo(camelCase). Withoutcontent_repo, behavior is unchanged —context.repois used as before.Testing
content-repodash alias, whitespace trimming, and invalid format fallback (warning +context.repoused)📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.