Skip to content

Commit 7e4fb52

Browse files
authored
Merge pull request #43824 from github/repo-sync
Repo sync
2 parents abb8578 + 040067e commit 7e4fb52

File tree

35 files changed

+1089
-22
lines changed

35 files changed

+1089
-22
lines changed

content/actions/reference/workflows-and-actions/events-that-trigger-workflows.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,16 @@ on:
515515

516516
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).
517517

518-
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.
518+
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).
519+
520+
### How the merge branch affects your workflow
521+
522+
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:
523+
524+
* `GITHUB_REF` is set to `refs/pull/PULL_REQUEST_NUMBER/merge`
525+
* `GITHUB_SHA` is the SHA of the merge commit on the merge branch
526+
527+
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.
519528

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

content/copilot/concepts/agents/code-review.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ This article provides an overview of {% data variables.copilot.copilot_code-revi
2626
{% data variables.copilot.copilot_code-review_short %} is supported in:
2727

2828
* {% data variables.product.prodname_dotcom_the_website %}
29+
* {% data variables.product.prodname_cli %}
2930
* {% data variables.product.prodname_mobile %}
3031
* {% data variables.product.prodname_vscode_shortname %}
3132
* {% data variables.product.prodname_vs %}

content/copilot/how-tos/use-copilot-agents/request-a-code-review/use-code-review.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,43 @@ These instructions explain how to use {% data variables.copilot.copilot_code-rev
235235
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.
236236

237237
{% endjetbrains %}
238+
239+
{% cli %}
240+
241+
## Prerequisites
242+
243+
* **Access to {% data variables.product.prodname_copilot_short %}**. {% data reusables.copilot.subscription-prerequisite %}
244+
* **{% data variables.product.prodname_cli %}**. You must have the {% data variables.product.prodname_cli %} installed and authenticated. See [AUTOTITLE](/github-cli/github-cli/quickstart).
245+
246+
## Using {% data variables.copilot.copilot_code-review_short %}
247+
248+
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.
249+
250+
### Requesting a review when creating a pull request
251+
252+
You can request a review from {% data variables.product.prodname_copilot_short %} when creating a new pull request using `gh pr create`:
253+
254+
```shell copy
255+
gh pr create --reviewer @copilot
256+
```
257+
258+
You can also select {% data variables.product.prodname_copilot_short %} interactively from the searchable reviewer prompt during `gh pr create`.
259+
260+
```text
261+
? Reviewers [Use arrows to move, space to select, <right> to all, <left> to none, type to filter]
262+
[ ] Search (7472 more)
263+
[x] monalisa (Mona Lisa)
264+
> [x] Copilot (AI)
265+
```
266+
267+
### Requesting a review on an existing pull request
268+
269+
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:
270+
271+
```shell copy
272+
gh pr edit PR-NUMBER --add-reviewer @copilot
273+
```
274+
275+
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.
276+
277+
{% endcli %}

content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,26 @@ When you create a pull request, you can choose to make it a draft pull request.
3535

3636
{% 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).
3737

38+
## Pull request refs and merge branches
39+
40+
When you open a pull request, {% data variables.product.github %} creates up to two temporary, read-only Git references for it:
41+
42+
| Ref | Description |
43+
| --- | --- |
44+
| `refs/pull/PULL_REQUEST_NUMBER/head` | Points to the latest commit on the pull request's head branch. |
45+
| `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. |
46+
47+
The merge branch automatically updates when the head branch or base branch changes. To fetch it locally:
48+
49+
```shell
50+
git fetch origin refs/pull/PULL_REQUEST_NUMBER/merge
51+
git checkout FETCH_HEAD
52+
```
53+
54+
Replace `PULL_REQUEST_NUMBER` with the number of your pull request.
55+
56+
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).
57+
3858
## Differences between commits on compare and pull request pages
3959

4060
The compare and pull request pages use different methods to calculate the diff for changed files:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +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`.
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).

src/content-render/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ export async function renderContent(
3838
try {
3939
template = await renderLiquid(template, context)
4040
if (context.markdownRequested) {
41-
const md = await renderMarkdown(template, context)
42-
43-
return md
41+
// Skip the remark pipeline when there are no internal links to rewrite,
42+
// since link rewriting is the only transformation the pipeline performs.
43+
if (!/\]\(\s*<?\//.test(template) && !/\]:\s*\//.test(template)) {
44+
return template.trim()
45+
}
46+
return await renderMarkdown(template, context)
4447
}
4548

4649
const html = await renderUnified(template, context, options)

src/github-apps/data/fpt-2022-11-28/fine-grained-pat-permissions.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5547,6 +5547,24 @@
55475547
"additional-permissions": false,
55485548
"access": "read"
55495549
},
5550+
{
5551+
"category": "dependency-graph",
5552+
"slug": "fetch-a-software-bill-of-materials-sbom-for-a-repository",
5553+
"subcategory": "sboms",
5554+
"verb": "get",
5555+
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}",
5556+
"additional-permissions": false,
5557+
"access": "read"
5558+
},
5559+
{
5560+
"category": "dependency-graph",
5561+
"slug": "request-generation-of-a-software-bill-of-materials-sbom-for-a-repository",
5562+
"subcategory": "sboms",
5563+
"verb": "get",
5564+
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/generate-report",
5565+
"additional-permissions": false,
5566+
"access": "read"
5567+
},
55505568
{
55515569
"category": "dependency-graph",
55525570
"slug": "create-a-snapshot-of-dependencies-for-a-repository",

src/github-apps/data/fpt-2022-11-28/fine-grained-pat.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2400,6 +2400,18 @@
24002400
"verb": "get",
24012401
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom"
24022402
},
2403+
{
2404+
"slug": "fetch-a-software-bill-of-materials-sbom-for-a-repository",
2405+
"subcategory": "sboms",
2406+
"verb": "get",
2407+
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}"
2408+
},
2409+
{
2410+
"slug": "request-generation-of-a-software-bill-of-materials-sbom-for-a-repository",
2411+
"subcategory": "sboms",
2412+
"verb": "get",
2413+
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/generate-report"
2414+
},
24032415
{
24042416
"slug": "create-a-snapshot-of-dependencies-for-a-repository",
24052417
"subcategory": "dependency-submission",

src/github-apps/data/fpt-2022-11-28/server-to-server-permissions.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7234,6 +7234,28 @@
72347234
"server-to-server": true,
72357235
"additional-permissions": false
72367236
},
7237+
{
7238+
"category": "dependency-graph",
7239+
"slug": "fetch-a-software-bill-of-materials-sbom-for-a-repository",
7240+
"subcategory": "sboms",
7241+
"verb": "get",
7242+
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}",
7243+
"access": "read",
7244+
"user-to-server": true,
7245+
"server-to-server": true,
7246+
"additional-permissions": false
7247+
},
7248+
{
7249+
"category": "dependency-graph",
7250+
"slug": "request-generation-of-a-software-bill-of-materials-sbom-for-a-repository",
7251+
"subcategory": "sboms",
7252+
"verb": "get",
7253+
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/generate-report",
7254+
"access": "read",
7255+
"user-to-server": true,
7256+
"server-to-server": true,
7257+
"additional-permissions": false
7258+
},
72377259
{
72387260
"category": "dependency-graph",
72397261
"slug": "create-a-snapshot-of-dependencies-for-a-repository",

src/github-apps/data/fpt-2022-11-28/server-to-server-rest.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2412,6 +2412,18 @@
24122412
"verb": "get",
24132413
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom"
24142414
},
2415+
{
2416+
"slug": "fetch-a-software-bill-of-materials-sbom-for-a-repository",
2417+
"subcategory": "sboms",
2418+
"verb": "get",
2419+
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}"
2420+
},
2421+
{
2422+
"slug": "request-generation-of-a-software-bill-of-materials-sbom-for-a-repository",
2423+
"subcategory": "sboms",
2424+
"verb": "get",
2425+
"requestPath": "/repos/{owner}/{repo}/dependency-graph/sbom/generate-report"
2426+
},
24152427
{
24162428
"slug": "create-a-snapshot-of-dependencies-for-a-repository",
24172429
"subcategory": "dependency-submission",

0 commit comments

Comments
 (0)