Skip to content

[safeoutputs] Add pull_request_number and repo fields to create_pull_request_review_comment tool schema#20963

Merged
pelikhan merged 4 commits intomainfrom
copilot/safeoutputs-add-pull-request-number-field
Mar 14, 2026
Merged

[safeoutputs] Add pull_request_number and repo fields to create_pull_request_review_comment tool schema#20963
pelikhan merged 4 commits intomainfrom
copilot/safeoutputs-add-pull-request-number-field

Conversation

Copy link
Contributor

Copilot AI commented Mar 14, 2026

create_pull_request_review_comment was missing pull_request_number and repo from its input schema. With additionalProperties: false, agents couldn't include these fields even when they were needed — the handler requires pull_request_number when target: "*" is configured, and supports repo for cross-repo targets, but both were blocked by the schema.

Changes

  • pkg/workflow/js/safe_outputs_tools.json — Added pull_request_number (number | string, optional) and repo (string, optional) to create_pull_request_review_comment properties; updated description to call out the target: "*" requirement
  • actions/setup/js/safe_outputs_tools.json — Mirrored same changes to the runtime copy
  • pkg/workflow/safe_output_validation_config.go — Added "pull_request_number": {OptionalPositiveInteger: true} to align with other PR-targeting tools (update_pull_request, push_to_pull_request_branch, add_reviewer, etc.)
"pull_request_number": {
  "type": ["number", "string"],
  "description": "Pull request number to add the review comment to. ... Required when the workflow target is '*' (any PR) — omitting it will cause the comment to fail."
},
"repo": {
  "type": "string",
  "description": "Target repository in 'owner/repo' format. If omitted, uses the configured target repository. Must be in the allowed-repos list if specified."
}

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 2 commits March 14, 2026 16:03
…ent tool schema

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 14, 2026 18:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for specifying an explicit PR number when creating inline PR review comments, fixing cases where workflows target "*" (any PR) and the handler requires pull_request_number.

Changes:

  • Added optional pull_request_number (number | string) to the create_pull_request_review_comment tool JSON schema (source + runtime copies) and clarified the "target: \"*\"" requirement in descriptions.
  • Updated Go safe-output validation config to allow/validate pull_request_number for create_pull_request_review_comment.
  • Regenerated/updated several workflow *.lock.yml files to reflect the tool schema + validation config changes.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
pkg/workflow/safe_output_validation_config.go Allows pull_request_number in validation rules for create_pull_request_review_comment.
pkg/workflow/js/safe_outputs_tools.json Adds pull_request_number to the tool schema and updates the tool description.
actions/setup/js/safe_outputs_tools.json Mirrors the schema + description updates for runtime usage.
.github/workflows/smoke-copilot.lock.yml Updates embedded tools/validation config to include pull_request_number.
.github/workflows/smoke-copilot-arm.lock.yml Same as above for ARM smoke workflow lock.
.github/workflows/smoke-claude.lock.yml Same as above for Claude smoke workflow lock.
.github/workflows/security-review.lock.yml Same as above for security-review workflow lock.
.github/workflows/pr-nitpick-reviewer.lock.yml Same as above for nitpick reviewer workflow lock.
.github/workflows/poem-bot.lock.yml Same as above for poem-bot workflow lock.
.github/workflows/grumpy-reviewer.lock.yml Same as above for grumpy-reviewer workflow lock.

💡 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.

"number",
"string"
]
},
"number",
"string"
]
},
"number",
"string"
]
},
Comment on lines +361 to +365
"pull_request_number": {
"type": [
"number",
"string"
],
"pull_request_number": {
"type": ["number", "string"],
"description": "Pull request number to add the review comment to. This is the numeric ID from the GitHub URL (e.g., 876 in github.com/owner/repo/pull/876). If omitted, adds the comment to the PR that triggered this workflow. Required when the workflow target is '*' (any PR) — omitting it will cause the comment to fail."
},
"number",
"string"
]
},
"number",
"string"
]
},
"number",
"string"
]
},
"number",
"string"
]
},
@pelikhan
Copy link
Contributor

@copilot review comments

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 14, 2026

@copilot review comments

Added repo to the create_pull_request_review_comment input schema in both pkg/workflow/js/safe_outputs_tools.json and actions/setup/js/safe_outputs_tools.json (3a4eddd). The field was already supported by the handler and present in the validation config but was blocked by additionalProperties: false. All affected lock files have been regenerated.

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:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw e17mAviFCL1i (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw -pack /home/REDACTED/work/gh-aw/gh-aw/cmd/gh-aw/main.go (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb --jq .object.sha (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [safeoutputs] Add pull_request_number to create_pull_request_review_comment tool schema [safeoutputs] Add pull_request_number and repo fields to create_pull_request_review_comment tool schema Mar 14, 2026
Copilot AI requested a review from pelikhan March 14, 2026 18:41
@pelikhan pelikhan merged commit 333f6dd into main Mar 14, 2026
81 checks passed
@pelikhan pelikhan deleted the copilot/safeoutputs-add-pull-request-number-field branch March 14, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[safeoutputs] Add pull_request_number field to create_pull_request_review_comment tool description

3 participants