Skip to content

Commit df9f040

Browse files
authored
Merge github/docs:main into fix-mannequin-pat-scopes
2 parents 5f3fd22 + f19a013 commit df9f040

354 files changed

Lines changed: 20134 additions & 533 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/auto-add-ready-for-doc-review.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,18 @@ jobs:
2727
- name: Check out repo
2828
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2929

30+
- name: Generate GitHub App token
31+
id: app-token
32+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
33+
with:
34+
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
35+
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
36+
3037
- name: Check team membership
3138
id: membership_check
3239
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
3340
with:
34-
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
41+
github-token: ${{ steps.app-token.outputs.token }}
3542
script: |
3643
try {
3744
await github.rest.teams.getMembershipForUserInOrg({
@@ -48,7 +55,7 @@ jobs:
4855
- name: Add ready-for-doc-review label
4956
if: steps.membership_check.outputs.result == 'false'
5057
env:
51-
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
58+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
5259
PR_URL: ${{ github.event.pull_request.html_url }}
5360
run: |
5461
gh pr edit $PR_URL --add-label ready-for-doc-review

.github/workflows/changelog-agent.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
5353
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
5454
owner: github
55-
repositories: docs-internal,docs-content
55+
repositories: docs-internal,docs-content,docs-engineering
5656

5757
- name: Resolve PR data
5858
id: resolve_pr
@@ -753,4 +753,4 @@ jobs:
753753
- uses: ./.github/actions/create-workflow-failure-issue
754754
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
755755
with:
756-
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
756+
token: ${{ steps.app-token.outputs.token }}

.github/workflows/changelog-prompt.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,18 @@ jobs:
1818
runs-on: ubuntu-latest
1919

2020
steps:
21+
- name: Generate GitHub App token
22+
id: app-token
23+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
24+
with:
25+
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
26+
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
27+
2128
- name: Check if PR author is in docs-content team
2229
id: check_team
2330
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
2431
with:
25-
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
32+
github-token: ${{ steps.app-token.outputs.token }}
2633
script: |
2734
try {
2835
const pr = context.payload.pull_request;
@@ -43,7 +50,7 @@ jobs:
4350

4451
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
4552
with:
46-
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
53+
github-token: ${{ steps.app-token.outputs.token }}
4754
script: |
4855
// Get PR author username
4956
const pr = context.payload.pull_request;

.github/workflows/check-for-spammy-issues.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,16 @@ jobs:
1717
if: github.repository == 'github/docs'
1818
runs-on: ubuntu-latest
1919
steps:
20+
- name: Generate GitHub App token
21+
id: app-token
22+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
23+
with:
24+
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
25+
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
26+
2027
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
2128
with:
22-
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
29+
github-token: ${{ steps.app-token.outputs.token }}
2330
script: |
2431
2532
const issue = context.payload.issue

.github/workflows/close-bad-repo-sync-prs.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,17 @@ jobs:
2121
name: Close if invalid repo-sync PR author
2222
runs-on: ubuntu-latest
2323
steps:
24+
- name: Generate GitHub App token
25+
id: app-token
26+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
27+
with:
28+
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
29+
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
30+
2431
- name: Close pull request if unwanted
2532
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
2633
with:
27-
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
34+
github-token: ${{ steps.app-token.outputs.token }}
2835
script: |
2936
const { owner, repo } = context.repo
3037
const prCreator = context.actor

.github/workflows/confirm-internal-staff-work-in-docs.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,21 @@ jobs:
2323
continue-on-error: true
2424
if: github.repository == 'github/docs' && github.actor != 'docs-bot'
2525
steps:
26+
- name: Generate GitHub App token
27+
id: app-token
28+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
29+
with:
30+
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
31+
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
32+
owner: github
33+
repositories: ${{ secrets.TEAM_CONTENT_REPO }}
34+
2635
- id: membership_check
2736
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
2837
env:
2938
TEAM_CONTENT_REPO: ${{ secrets.TEAM_CONTENT_REPO }}
3039
with:
31-
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
40+
github-token: ${{ steps.app-token.outputs.token }}
3241
script: |
3342
// Only perform this action with GitHub employees
3443
try {

.github/workflows/content-pipelines.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ jobs:
4545

4646
- uses: ./.github/actions/node-npm-setup
4747

48+
- name: Generate GitHub App token
49+
id: app-token
50+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
51+
with:
52+
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
53+
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
54+
owner: github
55+
repositories: docs-internal,copilot-cli-generated-docs,docs-engineering
56+
4857
- name: Install Copilot CLI
4958
run: npm install -g @github/copilot@prerelease
5059

@@ -92,7 +101,7 @@ jobs:
92101
93102
- name: Run content pipeline update script
94103
env:
95-
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
104+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
96105
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97106
COPILOT_GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_COPILOT }}
98107
run: npx tsx src/content-pipelines/scripts/update.ts --id "${{ matrix.id }}"
@@ -140,7 +149,7 @@ jobs:
140149
- name: Create or update PR
141150
if: steps.commit.outputs.has_changes == 'true'
142151
env:
143-
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
152+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
144153
UPDATE_BRANCH: ${{ steps.branch.outputs.update_branch }}
145154
PIPELINE_ID: ${{ matrix.id }}
146155
SOURCE_REPO: ${{ steps.source-info.outputs.source_repo }}
@@ -195,4 +204,4 @@ jobs:
195204
- uses: ./.github/actions/create-workflow-failure-issue
196205
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
197206
with:
198-
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
207+
token: ${{ steps.app-token.outputs.token }}

.github/workflows/copy-api-issue-to-internal.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,20 @@ jobs:
1818
runs-on: ubuntu-latest
1919
if: github.event.label.name == 'fix-internally' && github.repository == 'github/docs'
2020
steps:
21+
- name: Generate GitHub App token
22+
id: app-token
23+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
24+
with:
25+
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
26+
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
27+
owner: github
28+
repositories: docs,docs-content
29+
2130
- name: Check if this run was triggered by a member of the docs team
2231
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
2332
id: triggered-by-member
2433
with:
25-
github-token: ${{secrets.DOCS_BOT_PAT_BASE}}
34+
github-token: ${{ steps.app-token.outputs.token }}
2635
result-encoding: string
2736
script: |
2837
const triggerer_login = context.payload.sender.login
@@ -50,26 +59,26 @@ jobs:
5059
Copied to this repo by the [$GITHUB_WORKFLOW workflow run]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID)." --repo github/docs-content --label "workflow-generated")"
5160
echo 'NEW_ISSUE='$new_issue_url >> $GITHUB_ENV
5261
env:
53-
GITHUB_TOKEN: ${{secrets.DOCS_BOT_PAT_BASE}}
62+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
5463
ISSUE_TITLE: ${{ github.event.issue.title }}
5564
ISSUE_BODY: ${{ github.event.issue.body }}
5665

5766
- name: Comment on the old issue
5867
run: gh issue comment $OLD_ISSUE --body "Thank you for opening this issue! Updates to this documentation must be made internally. I have copied your issue to an internal issue, so I will close this issue."
5968
env:
60-
GITHUB_TOKEN: ${{secrets.DOCS_BOT_PAT_BASE}}
69+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
6170
OLD_ISSUE: ${{ github.event.issue.html_url }}
6271

6372
- name: Close the old issue
6473
run: gh issue close $OLD_ISSUE
6574
env:
66-
GITHUB_TOKEN: ${{secrets.DOCS_BOT_PAT_BASE}}
75+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
6776
OLD_ISSUE: ${{ github.event.issue.html_url }}
6877

6978
- name: Comment on the new issue
7079
run: gh issue comment $NEW_ISSUE --body "This issue was originally opened in the open source repo as $OLD_ISSUE"
7180
env:
72-
GITHUB_TOKEN: ${{secrets.DOCS_BOT_PAT_BASE}}
81+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
7382
NEW_ISSUE: ${{ env.NEW_ISSUE }}
7483
OLD_ISSUE: ${{ github.event.issue.html_url }}
7584

.github/workflows/create-changelog-pr.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ jobs:
2525
steps:
2626
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2727

28+
- name: Generate GitHub App token
29+
id: app-token
30+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
31+
with:
32+
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
33+
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
34+
owner: github
35+
repositories: docs-internal,docs-engineering
36+
2837
- name: 'Ensure ${{ env.CHANGELOG_FILE }} exists'
2938
run: |
3039
if [ ! -f ${{ env.CHANGELOG_FILE }} ]; then
@@ -36,7 +45,7 @@ jobs:
3645
id: hubber_check
3746
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
3847
with:
39-
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
48+
github-token: ${{ steps.app-token.outputs.token }}
4049
script: |
4150
try {
4251
await github.rest.teams.getMembershipForUserInOrg({
@@ -108,7 +117,7 @@ jobs:
108117
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
109118
id: create_pull_request
110119
with:
111-
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
120+
github-token: ${{ steps.app-token.outputs.token }}
112121
script: |
113122
const { data: pullRequest } = await github.rest.pulls.create({
114123
owner: context.repo.owner,
@@ -129,7 +138,7 @@ jobs:
129138
# Get the number of the PR that was just created:
130139
PULL_REQUEST_NUMBER: ${{ steps.create_pull_request.outputs.pull-request-number }}
131140
with:
132-
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
141+
github-token: ${{ steps.app-token.outputs.token }}
133142
script: |
134143
await github.rest.issues.addLabels({
135144
owner: context.repo.owner,
@@ -145,7 +154,7 @@ jobs:
145154
# Reuse the PR number captured earlier
146155
PULL_REQUEST_NUMBER: ${{ steps.create_pull_request.outputs.pull-request-number }}
147156
with:
148-
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
157+
github-token: ${{ steps.app-token.outputs.token }}
149158
script: |
150159
try {
151160
const username = context.payload.comment.user.login;
@@ -167,4 +176,4 @@ jobs:
167176
- uses: ./.github/actions/create-workflow-failure-issue
168177
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
169178
with:
170-
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
179+
token: ${{ steps.app-token.outputs.token }}

.github/workflows/docs-review-collect.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,20 @@ jobs:
3131
- name: Install dependencies
3232
run: npm ci
3333

34+
- name: Generate GitHub App token
35+
id: app-token
36+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
37+
with:
38+
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
39+
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
40+
owner: github
41+
repositories: audit-log-allowlists,docs-engineering
42+
3443
- name: Run script for audit-log-allowlists
3544
run: |
3645
npm run fr-add-docs-reviewers-requests
3746
env:
38-
TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
47+
TOKEN: ${{ steps.app-token.outputs.token }}
3948
PROJECT_NUMBER: 2936
4049
ORGANIZATION: 'github'
4150
REPO: 'audit-log-allowlists'
@@ -50,4 +59,4 @@ jobs:
5059
- uses: ./.github/actions/create-workflow-failure-issue
5160
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
5261
with:
53-
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
62+
token: ${{ steps.app-token.outputs.token }}

0 commit comments

Comments
 (0)