Skip to content

Commit f151f14

Browse files
authored
Merge pull request #43111 from github/repo-sync
Repo sync
2 parents ff34a83 + 9574312 commit f151f14

File tree

7 files changed

+162
-5
lines changed

7 files changed

+162
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Docs changelog
22

3+
**23 February 2026**
4+
5+
Added a new how-to article, [Automating tasks with Copilot CLI and GitHub Actions](https://docs.github.com/en/copilot/how-tos/copilot-cli/automate-with-actions), that walks through how to run Copilot CLI inside a GitHub Actions workflow in non-interactive (programmatic) mode. The article covers the full pattern—trigger, setup, install, authenticate, and run—and includes an example workflow that generates a daily summary of repository changes.
6+
<hr>
7+
38
**17 February 2026**
49

510
We’ve added a new tutorial, "[Using hooks with Copilot CLI for predictable, policy-compliant execution](https://docs.github.com/en/copilot/tutorials/copilot-cli-hooks)", to help teams configure repository-scoped hooks that log prompts and tool usage, enforce guardrails with `preToolUse`, and roll out policies safely across repositories.
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
---
2+
title: Automating tasks with Copilot CLI and GitHub Actions
3+
shortTitle: Automate with Actions
4+
intro: Integrate {% data variables.copilot.copilot_cli %} into your {% data variables.product.prodname_actions %} workflows.
5+
product: '{% data reusables.gated-features.copilot-cli %}'
6+
versions:
7+
feature: copilot
8+
topics:
9+
- Copilot
10+
- CLI
11+
contentType: how-tos
12+
category:
13+
- Build with Copilot CLI
14+
- Author and optimize with Copilot
15+
---
16+
17+
You can run {% data variables.copilot.copilot_cli %} in a {% data variables.product.prodname_actions %} workflow to automate AI-powered tasks as part of your CI/CD process. For example, you can summarize recent repository activity, generate reports, or scaffold project content. {% data variables.copilot.copilot_cli %} runs on the Actions runner like any other CLI tool, so you can install it during a job and invoke it from workflow steps.
18+
19+
## Understanding the workflow
20+
21+
You can define a job in a {% data variables.product.prodname_actions %} workflow that: installs {% data variables.copilot.copilot_cli_short %} on the runner, authenticates it, runs it in programmatic mode, and then handles the results. Programmatic mode is designed for scripts and automation and lets you pass a prompt non-interactively.
22+
23+
Workflows can follow this pattern:
24+
1. **Trigger**: Start the workflow on a schedule, in response to repository events, or manually.
25+
1. **Setup**: Checkout code, set up environment.
26+
1. **Install**: Install {% data variables.copilot.copilot_cli %} on the runner.
27+
1. **Authenticate**: Ensure the CLI has the necessary permissions to access the repository and make changes.
28+
1. **Run {% data variables.copilot.copilot_cli_short %}**: Invoke {% data variables.copilot.copilot_cli_short %} with a prompt describing the task you want to automate.
29+
30+
The following workflow generates a daily summary of repository changes and prints the summary to the workflow logs.
31+
32+
```yaml copy
33+
name: Daily summary
34+
on:
35+
workflow_dispatch:
36+
# Daily at 8:25 UTC
37+
schedule:
38+
- cron: '25 8 * * *'
39+
permissions:
40+
contents: read
41+
jobs:
42+
daily-summary:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Checkout
46+
uses: {% data reusables.actions.action-checkout %}
47+
48+
- name: Set up Node.js environment
49+
uses: {% data reusables.actions.action-setup-node %}
50+
51+
- name: Install Copilot CLI
52+
run: npm install -g @github/copilot
53+
54+
- name: Run Copilot CLI
55+
env:
56+
{% raw %}COPILOT_GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}{% endraw %}
57+
run: |
58+
TODAY=$(date +%Y-%m-%d)
59+
copilot -p "Review the git log for this repository and write a bullet point summary of all code changes that were made today ($TODAY). Include a brief description of what was changed."
60+
```
61+
62+
## Trigger
63+
64+
In this example, the workflow runs on a daily schedule and can also be triggered manually.
65+
66+
`The workflow_dispatch` trigger lets you run the workflow manually from the Actions tab, which is useful when testing changes to your prompt or workflow configuration.
67+
68+
The `schedule` trigger runs the workflow automatically at a specified time using cron syntax.
69+
70+
```yaml copy
71+
on:
72+
# Allows manual triggering of this workflow.
73+
workflow_dispatch:
74+
# Daily at 8:30 UTC
75+
schedule:
76+
- cron: '30 8 * * *'
77+
```
78+
79+
## Setup
80+
81+
Set up the job so {% data variables.copilot.copilot_cli_short %} can access your repository and run on the runner. This allows {% data variables.copilot.copilot_cli_short %} to analyze the repository context, when generating the daily summary.
82+
83+
The `permissions` block defines the scope granted to the built-in `GITHUB_TOKEN`. Because this workflow reads repository data and prints a summary to the logs, it requires `contents: read`.
84+
85+
```yaml copy
86+
permissions:
87+
contents: read
88+
jobs:
89+
daily-summary:
90+
runs-on: ubuntu-latest
91+
steps:
92+
- name: Checkout
93+
uses: {% data reusables.actions.action-checkout %}
94+
```
95+
96+
## Install
97+
98+
Install {% data variables.copilot.copilot_cli_short %} on the runner so your workflow can invoke it as a command. You can install {% data variables.copilot.copilot_cli %} using any supported installation method. For a full list of installation options, see [AUTOTITLE](/copilot/how-tos/copilot-cli/set-up-copilot-cli/install-copilot-cli).
99+
100+
In this example, the workflow installs {% data variables.copilot.copilot_cli %} globally with npm.
101+
102+
```yaml copy
103+
- name: Set up Node.js environment
104+
uses: {% data reusables.actions.action-setup-node %}
105+
106+
- name: Install Copilot CLI
107+
run: npm install -g @github/copilot
108+
```
109+
110+
## Authenticate
111+
112+
To authenticate {% data variables.copilot.copilot_cli_short %} in a workflow, create a {% data variables.product.pat_v2 %} (PAT) with the **Copilot Requests** permission. Store the PAT as a repository secret, then pass it to the CLI using an environment variable. For more information on creating a PAT for the CLI, see [Authenticating with a {% data variables.product.pat_generic %}](/copilot/how-tos/copilot-cli/set-up-copilot-cli/install-copilot-cli#authenticating-with-a-personal-access-token).
113+
114+
{% data variables.copilot.copilot_cli_short %} supports multiple authentication environment variables. In this example, the workflow uses `COPILOT_GITHUB_TOKEN`, which is specific to {% data variables.copilot.copilot_cli_short %} and avoids confusion for the built-in `GITHUB_TOKEN` environment variable.
115+
116+
```yaml copy
117+
- name: Run Copilot CLI
118+
env:
119+
{% raw %}COPILOT_GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}{% endraw %}
120+
```
121+
122+
123+
## Run {% data variables.copilot.copilot_cli_short %}
124+
125+
Run {% data variables.copilot.copilot_cli_short %} in programmatic mode when you want to use it in automation.
126+
`copilot -p PROMPT` executes a prompt programmatically and exits when the command completes.
127+
128+
In this workflow, {% data variables.copilot.copilot_cli_short %} references the repository content that is available in the job workspace. The command prints its response to standard output and the summary appears in the workflow logs.
129+
130+
```yaml copy
131+
- name: Run Copilot CLI
132+
env:
133+
{% raw %}COPILOT_GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}{% endraw %}
134+
run: |
135+
TODAY=$(date +%Y-%m-%d)
136+
copilot -p "Review the git log for this repository and write a bullet point summary of all code changes that were made today ($TODAY). Include a brief description of what was changed."
137+
```
138+
139+
## Next steps
140+
141+
After you confirm the workflow prints a summary to the logs, you can adapt the same pattern to other automation tasks. Start by changing the prompt you pass to `copilot -p PROMPT`, then decide what you want to do with the output.
142+
143+
* Write the summary to a file so later steps can use it as input.
144+
* Post the summary as a comment on an issue or a message in a team chat.
145+
* Summarize requests and output a draft changelog.
146+
147+
## Further reading
148+
149+
* [AUTOTITLE](/copilot/reference/cli-command-reference)
150+
* [AUTOTITLE](/copilot/reference/cli-plugin-reference)
151+

content/copilot/how-tos/copilot-cli/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ children:
1010
- /set-up-copilot-cli
1111
- /customize-copilot
1212
- /use-copilot-cli
13+
- /automate-with-actions
1314
contentType: how-tos
1415
---

content/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-organization-roles.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ product: 'Organizations on {% data variables.product.prodname_ghe_cloud %}{% ifv
1414

1515
{% data reusables.organizations.custom-org-roles-intro %} For more information, see [AUTOTITLE](/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles).
1616

17-
If you are an organization owner or have a custom role with the "View organization roles" or "Manage custom organization roles" permissions, you can view custom roles for the organization. With {% data variables.product.prodname_ghe_cloud %} and starting from {% data variables.product.prodname_ghe_server %} 3.19, if your enterprise owner has created organization roles, these roles can be seen and assigned as well, but not edited or deleted.
17+
If you are an organization owner or have a custom role with the "View organization roles" or "Manage custom organization roles" permissions, you can view custom roles for the organization.{% ifversion ent-owner-custom-org-roles %} If your enterprise owner has created organization roles, these roles can be seen and assigned as well, but not edited or deleted.{% endif %}
1818

1919
To find the "Custom roles" page, you can follow the first steps in [Creating a custom role](#creating-a-custom-role). The exact steps will vary depending on which other settings page you have access to.
2020

data/reusables/enterprise-onboarding/create-custom-roles.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
>[!NOTE] The ability for enterprise owners to create custom roles for an organization or enterprise is in public preview and subject to change.
2-
31
To tailor access management to your company's needs, you can create custom roles for your{% ifversion enterprise-custom-roles %} enterprise account and{% endif %} organizations.
42

53
Custom roles are sets of permissions for settings and resources that you can assign to users and teams.{% ifversion enterprise-custom-roles %} To learn best practices for using roles on {% data variables.product.github %}, see [AUTOTITLE](/admin/managing-accounts-and-repositories/managing-roles-in-your-enterprise/identify-role-requirements).{% endif %}
@@ -8,6 +6,8 @@ Custom roles are sets of permissions for settings and resources that you can ass
86

97
## Creating enterprise custom roles
108

9+
>[!NOTE] This feature is in {% data variables.release-phases.public_preview %} and subject to change.
10+
1111
Enterprise custom roles grant access to a subset of enterprise settings, such as viewing audit logs and creating organizations. {% data variables.product.github %} plans to expand the list of available permissions over time.
1212

1313
{% data reusables.enterprise-accounts.start-creating-custom-role %}

src/secret-scanning/data/pattern-docs/fpt/public-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2959,7 +2959,7 @@
29592959
- provider: Mapbox
29602960
supportedSecret: Mapbox Secret Access Token
29612961
secretType: mapbox_secret_access_token
2962-
isPublic: false
2962+
isPublic: true
29632963
isPrivateWithGhas: true
29642964
hasPushProtection: true
29652965
hasValidityCheck: true

src/secret-scanning/data/pattern-docs/ghec/public-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2959,7 +2959,7 @@
29592959
- provider: Mapbox
29602960
supportedSecret: Mapbox Secret Access Token
29612961
secretType: mapbox_secret_access_token
2962-
isPublic: false
2962+
isPublic: true
29632963
isPrivateWithGhas: true
29642964
hasPushProtection: true
29652965
hasValidityCheck: true

0 commit comments

Comments
 (0)