Skip to content

Repo sync #39493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 24, 2025
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 @@ -120,31 +120,32 @@ To fix this, you can do one of the following things.
* Use a volume type that supports `securityContext.fsGroup`. `hostPath` volumes do not support this property, whereas `local` volumes and other types of volumes do support it. Update the `fsGroup` of your runner pod to match the GID of the runner. You can do this by updating the `gha-runner-scale-set` helm chart values to include the following. Replace `VERSION` with the version of the `actions-runner` container image you want to use.

```yaml copy
spec:
template:
spec:
securityContext:
fsGroup: 123
fsGroup: 123
containers:
- name: runner
image: ghcr.io/actions/actions-runner:latest
command: ["/home/runner/run.sh"]
- name: runner
image: ghcr.io/actions/actions-runner:latest
command: ["/home/runner/run.sh"]
```

* If updating the `securityContext` of your runner pod is not a viable solution, you can work around the issue by using `initContainers` to change the mounted volume's ownership, as follows.

```yaml copy
template:
spec:
spec:
initContainers:
- name: kube-init
image: ghcr.io/actions/actions-runner:latest
command: ["sudo", "chown", "-R", "1001:123", "/home/runner/_work"]
- name: kube-init
image: ghcr.io/actions/actions-runner:latest
command: ["sudo", "chown", "-R", "1001:123", "/home/runner/_work"]
volumeMounts:
- name: work
- name: work
mountPath: /home/runner/_work
containers:
- name: runner
image: ghcr.io/actions/actions-runner:latest
command: ["/home/runner/run.sh"]
- name: runner
image: ghcr.io/actions/actions-runner:latest
command: ["/home/runner/run.sh"]
```

## Error: `failed to get access token for {% data variables.product.prodname_github_app %} auth: 401 Unauthorized`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ This allows you to update the configuration in a single location, but use the wo
> {% data reusables.copilot.code-review.preview-note %}
> * If you get a {% data variables.product.prodname_copilot_short %} subscription from an organization, you will only be able to participate in the {% data variables.release-phases.public_preview %} on the {% data variables.product.github %} website if an owner of your organization {% ifversion ghec %}or enterprise{% endif %} has enabled **Copilot in GitHub.com > Opt in to preview features** in the **{% data variables.product.prodname_copilot %} policies** page of the organization {% ifversion ghec %}or enterprise{% endif %} settings. See [AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#enabling-copilot-features-in-your-organization){% ifversion ghec %} and [AUTOTITLE](/copilot/managing-copilot/managing-copilot-for-your-enterprise/managing-policies-and-features-for-copilot-in-your-enterprise#copilot-in-githubcom){% endif %}.
By default, users request a review from {% data variables.product.prodname_copilot_short %} in the same way as they do from human reviewers. However, you can update or create an organization-level branch ruleset to automatically add {% data variables.product.prodname_copilot_short %} as a reviewer to all pull requests made to selected branches in all or selected repositories. See [AUTOTITLE](/copilot/using-github-copilot/code-review/configuring-automatic-code-review-by-copilot).
By default, users request a review from {% data variables.product.prodname_copilot_short %} in the same way as they do from human reviewers. However, you can update or create an organization-level branch ruleset to automatically add {% data variables.product.prodname_copilot_short %} as a reviewer to all pull requests made to selected branches in all or selected repositories. See [AUTOTITLE](/copilot/how-tos/agents/copilot-code-review/automatic-code-review).

{% data variables.product.prodname_copilot_short %} leaves a review comment on each pull request it reviews, without approving the pull request or requesting changes. This ensures that its review is advisory and will not block development work. Similarly, you should not enforce the resolution of suggestions made by {% data variables.product.prodname_copilot_short %} because AI suggestions have known limitations, see [AUTOTITLE](/copilot/responsible-use-of-github-copilot-features/responsible-use-of-github-copilot-code-review#limitations-of-github-copilot-code-review).

Expand Down
88 changes: 88 additions & 0 deletions content/copilot/concepts/code-review/code-review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
title: About Copilot code review
shortTitle: About code review
allowTitleToDifferFromFilename: true
intro: 'Find out how {% data variables.product.prodname_copilot_short %} can review pull requests for you.'
versions:
feature: copilot
topics:
- Copilot
redirect_from:
- /copilot/code-review
---

## Introduction

{% data variables.product.prodname_copilot %} can review your code and provide feedback. Where possible, {% data variables.product.prodname_copilot_short %}'s feedback includes suggested changes which you can apply with a couple of clicks.

{% data variables.product.prodname_copilot_short %} can review code written in any programming language.

This article provides an overview of {% data variables.copilot.copilot_code-review_short %}. For instructions on how to request a code review from {% data variables.product.prodname_copilot_short %}, see [AUTOTITLE](/copilot/how-tos/agents/copilot-code-review/using-copilot-code-review).

## Availability

{% data variables.copilot.copilot_code-review_short %} is—with one exception—a premium feature, available with the {% data variables.copilot.copilot_pro_short %}, {% data variables.copilot.copilot_pro_plus_short %}, {% data variables.copilot.copilot_business_short %}, and {% data variables.copilot.copilot_enterprise_short %} plans.

The exception is the review of a selection of code within a file in {% data variables.product.prodname_vscode %}. This is a standard feature available to all {% data variables.product.prodname_copilot_short %} users in {% data variables.product.prodname_vscode_shortname %}.

If you receive {% data variables.product.prodname_copilot_short %} from an organization then, to be able to request a pull request review from {% data variables.product.prodname_copilot_short %} on {% data variables.product.prodname_dotcom_the_website %} or in {% data variables.product.prodname_mobile %}, the **{% data variables.product.prodname_copilot_short %} in {% data variables.product.prodname_dotcom_the_website %}** option must be enabled in the {% data variables.product.prodname_copilot_short %} policy settings for the organization. See [AUTOTITLE](/copilot/how-tos/administer/organizations/managing-policies-for-copilot-in-your-organization).

## Code review monthly quota

When you assign {% data variables.product.prodname_copilot_short %} as a reviewer for a pull request—or when you request {% data variables.product.prodname_copilot_short %} to review all of your uncommitted changes in your IDE—your monthly quota of Copilot premium requests is reduced by one. For information about premium requests, see [AUTOTITLE](/copilot/managing-copilot/monitoring-usage-and-entitlements/about-premium-requests).

If a repository is configured to automatically request a code review from {% data variables.product.prodname_copilot_short %} for all new pull requests, the premium request usage is applied to the quota of the pull request author. If a pull request is created by {% data variables.product.prodname_actions %} or by a bot, the usage will apply to the user who triggered the workflow (if identifiable), or to a designated billing owner.

When you reach your monthly quota you will not be able to get a code review from {% data variables.product.prodname_copilot_short %} until your quota resets—unless you upgrade your {% data variables.product.prodname_copilot_short %} plan or enable additional premium requests.

## {% data variables.copilot.copilot_code-review_short %} in {% data variables.product.prodname_vscode %}

{% data variables.copilot.copilot_code-review_short %} in {% data variables.product.prodname_vscode %} supports two types of review:

* **Review selection:**
* Highlight code and ask for an initial review.
* Standard {% data variables.product.prodname_copilot_short %} feature. No premium requests used.
* Does not support custom instructions or custom coding guidelines.
* **Review changes:**
* Request a deeper review of all of your uncommitted changes.
* Premium feature. Uses one premium request from your monthly quota per review.
* Supports custom instructions and custom coding guidelines.

## Validating {% data variables.product.prodname_copilot_short %} code reviews

{% data variables.product.prodname_copilot_short %} isn't guaranteed to spot all problems or issues in a pull request, and sometimes it will make mistakes. Always validate {% data variables.product.prodname_copilot_short %}'s feedback carefully, and supplement {% data variables.product.prodname_copilot_short %}'s feedback with a human review.

For more information, see [AUTOTITLE](/copilot/responsible-use-of-github-copilot-features/responsible-use-of-github-copilot-code-review).

## About automatic pull request reviews

By default, {% data variables.product.prodname_copilot_short %} will only review a pull request if it's assigned to the pull request in the same way you would assign a human reviewer. However:

* Individual users on the {% data variables.copilot.copilot_pro_short %} or {% data variables.copilot.copilot_pro_plus_short %} plan can configure {% data variables.product.prodname_copilot_short %} to automatically review all pull requests they create.
* Repository owners can configure {% data variables.product.prodname_copilot_short %} to automatically review all pull requests in the repository that are created by people with access to {% data variables.product.prodname_copilot_short %}.
* Organization owners can configure {% data variables.product.prodname_copilot_short %} to automatically review all pull requests in some or all of the repositories in the organization where the pull request is created by a {% data variables.product.prodname_copilot_short %} user.

### Triggering an automatic pull request review

After you configure automatic code review, {% data variables.product.prodname_copilot_short %} will review pull requests in the following situations:

* When a pull request is created as an "Open" pull request.

A review is not triggered if the pull request is created as a "Draft" pull request.

* The first time a "Draft" pull request is switched to "Open".

> [!NOTE]
> {% data variables.product.prodname_copilot_short %} only automatically reviews a pull request once. If you make changes to the pull request after it has been automatically reviewed and you want {% data variables.product.prodname_copilot_short %} to re-review the pull request, you must request this manually. To do this, click the {% octicon "sync" aria-label="Re-request review" %} button next to {% data variables.product.prodname_copilot_short %}'s name in the **Reviewers** menu.

### Limits on automatic pull request reviews

{% data variables.copilot.copilot_code-review_short %} is a premium feature with a per-person monthly quota. When {% data variables.product.prodname_copilot_short %} carries out an automatic review, it uses one premium request from the quota of the user who created the pull request. For more information, see [AUTOTITLE](/copilot/using-github-copilot/code-review/using-copilot-code-review#code-review-monthly-quota).

## Configuring automatic pull request reviews

For details of how to configure {% data variables.product.prodname_copilot_short %} to automatically review new pull requests, see [AUTOTITLE](/copilot/how-tos/agents/copilot-code-review/configuring-automatic-code-review-by-copilot).

## Further reading

* [AUTOTITLE](/copilot/how-tos/agents/copilot-code-review/using-copilot-code-review)
75 changes: 75 additions & 0 deletions content/copilot/concepts/code-review/coding-guidelines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
title: About coding guidelines for GitHub Copilot code review
shortTitle: Coding guidelines
allowTitleToDifferFromFilename: true
intro: "Find out how you can use custom coding guidelines to improve {% data variables.product.prodname_copilot_short %}'s pull request reviews."
versions:
feature: copilot
topics:
- Copilot
---

{% data reusables.copilot.code-review.custom-coding-guidelines-prerequisites %} See [AUTOTITLE](/copilot/how-tos/custom-instructions/adding-repository-custom-instructions-for-github-copilot?tool=webui).

## About coding guidelines

You can customize {% data variables.copilot.copilot_code-review_short %} with custom coding guidelines written in natural language. For more information on {% data variables.copilot.copilot_code-review_short %}, see [AUTOTITLE](/copilot/concepts/code-review/code-review).

With coding guidelines, {% data variables.product.prodname_copilot_short %} can give feedback based on your organization's specific coding style and best practices.

Because {% data variables.copilot.copilot_code-review_short %} is powered by a large language model, it can help with enforcing coding guidelines that are not covered by your linter or static analysis tool.

Coding guidelines are configured at the repository level. You can create and enable up to 6 coding guidelines per repository. See [AUTOTITLE](/copilot/how-tos/agents/copilot-code-review/configuring-coding-guidelines).

When you request a review from {% data variables.product.prodname_copilot_short %}, it will automatically use the repository's enabled coding guidelines to review your code.

Comments generated based on a coding guideline will include a message, highlighting their source.

> [!NOTE] Coding guidelines only apply to code reviews carried out by Copilot. The guidelines do not affect Copilot code completion suggestions, or code suggested in Copilot Chat responses.

## Dos and don'ts for coding guidelines

* **Do** use simple, clear and concise language to describe your coding guideline.
* **Do** be as specific as possible about what Copilot should look for - that is, what you do or don't want to see in your code.
* **Do** take a look at the [Coding guidelines examples](#coding-guidelines-examples) below for some inspiration.
* **Don't** try to use coding guidelines to enforce style guidelines that can be covered by your linter or static analysis tool.
* **Don't** use wording that is ambiguous or could be interpreted in different ways.
* **Don't** try to fit multiple different ideas into a single coding guideline.

## Coding guidelines examples

### Example 1: Avoid using magic numbers

**Title:** <code>Avoid using magic numbers</code>

**Description:** <code>Don't use magic numbers in code. Numbers should be defined as constants or variables with meaningful names.</code>

**Path patterns:** `**/*.py`

### Example 2: Don't use `SELECT *` in SQL queries

**Title:** <code>Don't use &#96;SELECT \*&#96; in SQL queries</code>

**Description:** <code>Don't use &#96;SELECT \*&#96; in SQL queries. Always specify the columns you want to select. &#96;COUNT(\*)&#96; is allowed.</code>

**Path patterns:** None (applies to all file types, as SQL queries may be embedded in code).

### Example 3: Use `fetch` for HTTP requests

**Title:** <code>Use &#96;fetch&#96; for HTTP requests</code>

**Description:** <code>Use &#96;fetch&#96; for HTTP requests, not &#96;axios&#96; or &#96;superagent&#96; or other libraries.</code>

**Path patterns:** `**/*.ts`, `**/*.js`, `**/*.jsx`, `**/*.tsx`

### Example 4: Always tag metrics with the current environment

**Title:** <code>Always tag metrics with the current environment</code>

**Description:** <code>Always include a &#96;env&#96; tag with the current environment when emitting metrics, for example, &#96;env:prod&#96; or &#96;env:dev&#96;.</code>

**Path patterns:** `*/*.go`, `*/*.java`

## Further reading

* [AUTOTITLE](/copilot/how-tos/agents/copilot-code-review/configuring-coding-guidelines)
14 changes: 14 additions & 0 deletions content/copilot/concepts/code-review/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: 'Concepts for GitHub Copilot code review'
shortTitle: Code review
intro: 'Understand how you can use {% data variables.product.prodname_copilot_short %} to review your code.'
versions:
feature: copilot
topics:
- Copilot
children:
- /code-review
- /coding-guidelines
---

These articles provide an introduction to {% data variables.copilot.copilot_code-review_short %}. For instructions on configuring and using {% data variables.copilot.copilot_code-review_short %}, see the how-to articles under [AUTOTITLE](/copilot/how-tos/agents/copilot-code-review).
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ redirect_from:
- /copilot/using-github-copilot/using-copilot-coding-agent-to-work-on-issues/about-assigning-issues-to-copilot
- /copilot/using-github-copilot/using-copilot-coding-agent-to-work-on-issues/about-assigning-tasks-to-copilot
- /copilot/using-github-copilot/coding-agent/about-assigning-tasks-to-copilot
- /copilot/concepts/about-copilot-coding-agent
---

> [!NOTE]
Expand Down Expand Up @@ -63,7 +64,7 @@ Having {% data variables.product.prodname_copilot_short %} as an additional codi

### Making {% data variables.copilot.copilot_coding_agent %} available

Before you can assign tasks to {% data variables.product.prodname_copilot_short %}, it must be enabled. See [AUTOTITLE](/copilot/using-github-copilot/coding-agent/enabling-copilot-coding-agent).
Before you can assign tasks to {% data variables.product.prodname_copilot_short %}, it must be enabled. See [AUTOTITLE](/copilot/concepts/coding-agent/about-enabling-coding-agent).

## {% data variables.copilot.copilot_coding_agent %} usage costs

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: Enabling Copilot coding agent
shortTitle: Enable coding agent
intro: 'You can allow {% data variables.product.prodname_copilot_short %} to work on code and raise pull requests.'
title: 'About enabling {% data variables.copilot.copilot_coding_agent %}'
shortTitle: 'Enabling {% data variables.copilot.copilot_coding_agent_short %}'
allowTitleToDifferFromFilename: true
intro: 'Find out about enabling {% data variables.copilot.copilot_coding_agent %} for {% data variables.copilot.copilot_enterprise %} and {% data variables.copilot.copilot_for_business %}, and about disabling the agent for specific repositories.'
product: '{% data reusables.gated-features.copilot-coding-agent %}<br><a href="https://github.com/features/copilot/plans?ref_cta=Copilot+plans+signup&ref_loc=enabling+copilot+coding+agent&ref_page=docs" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Sign up for {% data variables.product.prodname_copilot_short %}</span> {% octicon "link-external" height:16 %}</a>'
versions:
feature: copilot
topics:
- Copilot
type: how_to
redirect_from:
- /copilot/using-github-copilot/using-copilot-coding-agent-to-work-on-tasks/enabling-copilot-coding-agent
- /copilot/using-github-copilot/using-copilot-coding-agent-to-work-on-issues/enabling-copilot-coding-agent-for-your-personal-repositories
Expand All @@ -26,7 +26,7 @@ redirect_from:

If you are a {% data variables.copilot.copilot_enterprise %} or {% data variables.copilot.copilot_for_business %} subscriber, {% data variables.copilot.copilot_coding_agent %} is disabled by default and must be enabled by an administrator before it is available for use.

If you are a {% data variables.copilot.copilot_pro_plus %} subscriber, {% data variables.copilot.copilot_coding_agent %} is enabled by default.
If you are a {% data variables.copilot.copilot_pro %} or Pro+ subscriber, {% data variables.copilot.copilot_coding_agent %} is enabled by default.

Once enabled, you can use {% data variables.copilot.copilot_coding_agent %} in any repository, provided that an administrator hasn't opted the repository out.

Expand Down
Loading
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy