Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,16 @@ on:

Runs your workflow when activity on a pull request in the workflow's repository occurs. For example, if no activity types are specified, the workflow runs when a pull request is opened or reopened or when the head branch of the pull request is updated. For activity related to pull request reviews, pull request review comments, or pull request comments, use the [`pull_request_review`](#pull_request_review), [`pull_request_review_comment`](#pull_request_review_comment), or [`issue_comment`](#issue_comment) events instead. For information about the pull request APIs, see [AUTOTITLE](/graphql/reference/objects#pullrequest) in the GraphQL API documentation or [AUTOTITLE](/rest/pulls).

Note that `GITHUB_SHA` for this event is the last merge commit of the pull request merge branch. If you want to get the commit ID for the last commit to the head branch of the pull request, use `github.event.pull_request.head.sha` instead.
Note that `GITHUB_SHA` for this event is the last merge commit of the pull request merge branch. If you want to get the commit ID for the last commit to the head branch of the pull request, use `github.event.pull_request.head.sha` instead. For more information about merge branches, see [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#pull-request-refs-and-merge-branches).

### How the merge branch affects your workflow

For open, mergeable pull requests, workflows triggered by the `pull_request` event set `GITHUB_REF` to the merge branch. Because `actions/checkout` uses `GITHUB_REF` by default, it checks out the merge branch. Your CI tests run against the merged result, not just the head branch alone:

* `GITHUB_REF` is set to `refs/pull/PULL_REQUEST_NUMBER/merge`
* `GITHUB_SHA` is the SHA of the merge commit on the merge branch

To test only the head branch commits without simulating a merge, check out the head branch using `github.event.pull_request.head.sha` in your workflow.

For example, you can run a workflow when a pull request has been opened or reopened.

Expand Down
1 change: 1 addition & 0 deletions content/copilot/concepts/agents/code-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This article provides an overview of {% data variables.copilot.copilot_code-revi
{% data variables.copilot.copilot_code-review_short %} is supported in:

* {% data variables.product.prodname_dotcom_the_website %}
* {% data variables.product.prodname_cli %}
* {% data variables.product.prodname_mobile %}
* {% data variables.product.prodname_vscode_shortname %}
* {% data variables.product.prodname_vs %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,43 @@ These instructions explain how to use {% data variables.copilot.copilot_code-rev
1. If there is more than one comment, use the up and down arrows, at the top right of the popup, to navigate between comments.

{% endjetbrains %}

{% cli %}

## Prerequisites

* **Access to {% data variables.product.prodname_copilot_short %}**. {% data reusables.copilot.subscription-prerequisite %}
* **{% data variables.product.prodname_cli %}**. You must have the {% data variables.product.prodname_cli %} installed and authenticated. See [AUTOTITLE](/github-cli/github-cli/quickstart).

## Using {% data variables.copilot.copilot_code-review_short %}

These instructions explain how to use {% data variables.copilot.copilot_code-review_short %} with the {% data variables.product.prodname_cli %}. To see instructions for other popular coding environments, click the appropriate tab at the top of the page.

### Requesting a review when creating a pull request

You can request a review from {% data variables.product.prodname_copilot_short %} when creating a new pull request using `gh pr create`:

```shell copy
gh pr create --reviewer @copilot
```

You can also select {% data variables.product.prodname_copilot_short %} interactively from the searchable reviewer prompt during `gh pr create`.

```text
? Reviewers [Use arrows to move, space to select, <right> to all, <left> to none, type to filter]
[ ] Search (7472 more)
[x] monalisa (Mona Lisa)
> [x] Copilot (AI)
```

### Requesting a review on an existing pull request

To request a review from {% data variables.product.prodname_copilot_short %} on an existing pull request, use `gh pr edit`. If you are not on the pull request's branch, specify the pull request number:

```shell copy
gh pr edit PR-NUMBER --add-reviewer @copilot
```

Replace `PR-NUMBER` with the number of the pull request you want reviewed. If you have the pull request's branch checked out, you can omit the number.

{% endcli %}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,26 @@ When you create a pull request, you can choose to make it a draft pull request.

{% data reusables.pull_requests.mark-ready-review %} You can convert a pull request to a draft at any time. See [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request).

## Pull request refs and merge branches

When you open a pull request, {% data variables.product.github %} creates up to two temporary, read-only Git references for it:

| Ref | Description |
| --- | --- |
| `refs/pull/PULL_REQUEST_NUMBER/head` | Points to the latest commit on the pull request's head branch. |
| `refs/pull/PULL_REQUEST_NUMBER/merge` | A merge branch—a simulated merge commit that represents what the repository would look like if the pull request were merged right now. This ref is only available when the pull request has no merge conflicts. |

The merge branch automatically updates when the head branch or base branch changes. To fetch it locally:

```shell
git fetch origin refs/pull/PULL_REQUEST_NUMBER/merge
git checkout FETCH_HEAD
```

Replace `PULL_REQUEST_NUMBER` with the number of your pull request.

For information about how {% data variables.product.prodname_actions %} uses the merge branch, see [AUTOTITLE](/actions/reference/workflows-and-actions/events-that-trigger-workflows#how-the-merge-branch-affects-your-workflow).

## Differences between commits on compare and pull request pages

The compare and pull request pages use different methods to calculate the diff for changed files:
Expand Down
2 changes: 1 addition & 1 deletion data/reusables/actions/ref-description.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
The fully-formed ref of the branch or tag that triggered the workflow run. For workflows triggered by `push`, this is the branch or tag ref that was pushed. For workflows triggered by `pull_request` that were not merged, this is the pull request merge branch. If the pull request was merged, this is the head branch. For workflows triggered by `release`, this is the release tag created. For other triggers, this is the branch or tag ref that triggered the workflow run. This is only set if a branch or tag is available for the event type. The ref given is fully-formed, meaning that for branches the format is `refs/heads/<branch_name>`. For pull requests events except `pull_request_target` that were not merged, it is `refs/pull/<pr_number>/merge`. `pull_request_target` events have the `ref` from the base branch. For tags it is `refs/tags/<tag_name>`. For example, `refs/heads/feature-branch-1`.
The fully-formed ref of the branch or tag that triggered the workflow run. For workflows triggered by `push`, this is the branch or tag ref that was pushed. For workflows triggered by `pull_request` that were not merged, this is the pull request merge branch. If the pull request was merged, this is the branch it was merged into. For workflows triggered by `release`, this is the release tag created. For other triggers, this is the branch or tag ref that triggered the workflow run. This is only set if a branch or tag is available for the event type. The ref given is fully-formed, meaning that for branches the format is `refs/heads/<branch_name>`. For pull request events except `pull_request_target` that were not merged, it is `refs/pull/<pr_number>/merge`. `pull_request_target` events have the `ref` from the base branch. For tags it is `refs/tags/<tag_name>`. For example, `refs/heads/feature-branch-1`. For more information about pull request merge branches, see [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#pull-request-refs-and-merge-branches).
9 changes: 6 additions & 3 deletions src/content-render/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ export async function renderContent(
try {
template = await renderLiquid(template, context)
if (context.markdownRequested) {
const md = await renderMarkdown(template, context)

return md
// Skip the remark pipeline when there are no internal links to rewrite,
// since link rewriting is the only transformation the pipeline performs.
if (!/\]\(\s*<?\//.test(template) && !/\]:\s*\//.test(template)) {
return template.trim()
}
return await renderMarkdown(template, context)
}

const html = await renderUnified(template, context, options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5547,6 +5547,24 @@
"additional-permissions": false,
"access": "read"
},
{
"category": "dependency-graph",
"slug": "fetch-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}",
"additional-permissions": false,
"access": "read"
},
{
"category": "dependency-graph",
"slug": "request-generation-of-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/generate-report",
"additional-permissions": false,
"access": "read"
},
{
"category": "dependency-graph",
"slug": "create-a-snapshot-of-dependencies-for-a-repository",
Expand Down
12 changes: 12 additions & 0 deletions src/github-apps/data/fpt-2022-11-28/fine-grained-pat.json
Original file line number Diff line number Diff line change
Expand Up @@ -2400,6 +2400,18 @@
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom"
},
{
"slug": "fetch-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}"
},
{
"slug": "request-generation-of-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/generate-report"
},
{
"slug": "create-a-snapshot-of-dependencies-for-a-repository",
"subcategory": "dependency-submission",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7234,6 +7234,28 @@
"server-to-server": true,
"additional-permissions": false
},
{
"category": "dependency-graph",
"slug": "fetch-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}",
"access": "read",
"user-to-server": true,
"server-to-server": true,
"additional-permissions": false
},
{
"category": "dependency-graph",
"slug": "request-generation-of-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/generate-report",
"access": "read",
"user-to-server": true,
"server-to-server": true,
"additional-permissions": false
},
{
"category": "dependency-graph",
"slug": "create-a-snapshot-of-dependencies-for-a-repository",
Expand Down
12 changes: 12 additions & 0 deletions src/github-apps/data/fpt-2022-11-28/server-to-server-rest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2412,6 +2412,18 @@
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom"
},
{
"slug": "fetch-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}"
},
{
"slug": "request-generation-of-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/generate-report"
},
{
"slug": "create-a-snapshot-of-dependencies-for-a-repository",
"subcategory": "dependency-submission",
Expand Down
12 changes: 12 additions & 0 deletions src/github-apps/data/fpt-2022-11-28/user-to-server-rest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2678,6 +2678,18 @@
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom"
},
{
"slug": "fetch-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}"
},
{
"slug": "request-generation-of-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/generate-report"
},
{
"slug": "create-a-snapshot-of-dependencies-for-a-repository",
"subcategory": "dependency-submission",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5547,6 +5547,24 @@
"additional-permissions": false,
"access": "read"
},
{
"category": "dependency-graph",
"slug": "fetch-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}",
"additional-permissions": false,
"access": "read"
},
{
"category": "dependency-graph",
"slug": "request-generation-of-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/generate-report",
"additional-permissions": false,
"access": "read"
},
{
"category": "dependency-graph",
"slug": "create-a-snapshot-of-dependencies-for-a-repository",
Expand Down
12 changes: 12 additions & 0 deletions src/github-apps/data/fpt-2026-03-10/fine-grained-pat.json
Original file line number Diff line number Diff line change
Expand Up @@ -2400,6 +2400,18 @@
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom"
},
{
"slug": "fetch-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}"
},
{
"slug": "request-generation-of-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/generate-report"
},
{
"slug": "create-a-snapshot-of-dependencies-for-a-repository",
"subcategory": "dependency-submission",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7234,6 +7234,28 @@
"server-to-server": true,
"additional-permissions": false
},
{
"category": "dependency-graph",
"slug": "fetch-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}",
"access": "read",
"user-to-server": true,
"server-to-server": true,
"additional-permissions": false
},
{
"category": "dependency-graph",
"slug": "request-generation-of-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/generate-report",
"access": "read",
"user-to-server": true,
"server-to-server": true,
"additional-permissions": false
},
{
"category": "dependency-graph",
"slug": "create-a-snapshot-of-dependencies-for-a-repository",
Expand Down
12 changes: 12 additions & 0 deletions src/github-apps/data/fpt-2026-03-10/server-to-server-rest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2412,6 +2412,18 @@
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom"
},
{
"slug": "fetch-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}"
},
{
"slug": "request-generation-of-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/generate-report"
},
{
"slug": "create-a-snapshot-of-dependencies-for-a-repository",
"subcategory": "dependency-submission",
Expand Down
12 changes: 12 additions & 0 deletions src/github-apps/data/fpt-2026-03-10/user-to-server-rest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2678,6 +2678,18 @@
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom"
},
{
"slug": "fetch-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}"
},
{
"slug": "request-generation-of-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/generate-report"
},
{
"slug": "create-a-snapshot-of-dependencies-for-a-repository",
"subcategory": "dependency-submission",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6129,6 +6129,24 @@
"additional-permissions": false,
"access": "read"
},
{
"category": "dependency-graph",
"slug": "fetch-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}",
"additional-permissions": false,
"access": "read"
},
{
"category": "dependency-graph",
"slug": "request-generation-of-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/generate-report",
"additional-permissions": false,
"access": "read"
},
{
"category": "dependency-graph",
"slug": "create-a-snapshot-of-dependencies-for-a-repository",
Expand Down
12 changes: 12 additions & 0 deletions src/github-apps/data/ghec-2022-11-28/fine-grained-pat.json
Original file line number Diff line number Diff line change
Expand Up @@ -2444,6 +2444,18 @@
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom"
},
{
"slug": "fetch-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}"
},
{
"slug": "request-generation-of-a-software-bill-of-materials-sbom-for-a-repository",
"subcategory": "sboms",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/generate-report"
},
{
"slug": "create-a-snapshot-of-dependencies-for-a-repository",
"subcategory": "dependency-submission",
Expand Down
Loading
Loading