Skip to content

Commit f4e8afc

Browse files
authored
Merge pull request #46111 from github/repo-sync
Repo sync
2 parents b5f08dd + c72567d commit f4e8afc

310 files changed

Lines changed: 1827 additions & 4575 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/send-to-triage-board.yml‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Add new issues and PRs to central triage board
22

3-
# **What it does**: Adds newly opened or reopened issues and pull requests in github/docs to the right place for triage, and stamps the item with today's date.
4-
# **Why we have it**: To ensure incoming work in the public docs repo is triaged properly.
5-
# **Who does it impact**: Writers, FRs.
3+
# Adds new, reopened, and ready-for-review github/docs work to the Central Triage Group board.
4+
# Sets today's date so first responders can triage it.
65

76
on:
87
issues:
@@ -22,7 +21,7 @@ jobs:
2221
env:
2322
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
2423
ITEM_URL: ${{ github.event.issue.html_url || github.event.pull_request.html_url }}
25-
# Add to the Central Triage Group project board and set date to now
24+
# These IDs point to the Central Triage Group board and its date field.
2625
PROJECT_NUMBER: '19598'
2726
PROJECT_ID: 'PVT_kwDNJr_OAJ4AfQ'
2827
DATE_FIELD_ID: 'PVTF_lADNJr_OAJ4Afc4IAbbv'

‎.github/workflows/site-policy-reminder.yml‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Site Policy Reminder
22

3-
# **What it does**: Automated comment reminder on a PR to change the title for public consumption before merging and to run the Site Policy repo sync action
4-
# **Why we have it**: Titles of merged PRs to Site Policies are sent to the public site-policy repo when the repos are synced
5-
# **Who does it impact**: Everyone merging changes to Site Policies
3+
# Site Policy PR titles appear in github/site-policy after sync, so they need public wording.
4+
# The reminder tells admins when to run the sync action.
65

76
on:
87
pull_request:

‎.github/workflows/site-policy-sync.yml‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
name: Site policy sync
22

3-
# **What it does**: Creates a branch in our site-policy repo with changes to site policy docs.
4-
# **Why we have it**: We want to keep the site-policy repo up to date.
5-
# **Who does it impact**: site-policy-admins and Developer Policy teams.
3+
# Keeps github/site-policy current with internal site policy docs.
64

7-
# Controls when the action will run.
85
on:
9-
# Triggers the workflow pull requests merged to the main branch
106
pull_request:
117
branches:
128
- main

‎.github/workflows/sme-review-tracking-issue.yml‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
name: Create SME review tracking issue
22

3-
# **What it does**: Creates an SME review tracking issue when the `needs SME` label is applied to a PR or issue
4-
# **Why we have it**: We do not want to manually create an SME review tracking issue when an SME review is needed
5-
# **Who does it impact**: Hubbers
3+
# Creates a technical-content tracking issue when a github/docs PR or issue gets the needs SME label.
64

75
on:
86
issues:
97
types:
108
- labeled
11-
# Required in lieu of `pull_request` so that this workflow can query users in org to determine membership.
9+
# pull_request_target gives fork PRs the DOCS_BOT_PAT_BASE secret to create the issue.
1210
pull_request_target:
1311
types:
1412
- labeled
@@ -31,7 +29,6 @@ jobs:
3129
3230
const issueNo = context.number || context.issue.number
3331
34-
// Create an issue in technical-content repo
3532
await github.rest.issues.create({
3633
owner: 'github',
3734
repo: 'technical-content',

‎.github/workflows/stale.yml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Stale check for stalled pull requests in the docs-internal repository
22

3-
# **What it does**: Identifies pull requests that have been inactive for 30 days.
4-
# **Why we have it**: We want to avoid pull requests that are stalled and not being reviewed.
5-
# **Who does it impact**: Everyone that works in the internal repository.
3+
# Marks internal PRs stale after 30 inactive days and closes them 14 days later without a response.
64

75
on:
86
schedule:

‎.github/workflows/sync-audit-logs.yml‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Sync Audit Log data
22

3-
# **What it does**: This updates our Audit Logs schema.
4-
# **Why we have it**: We want our Audit Logs up to date.
5-
# **Who does it impact**: Docs engineering, people reading Audit Logs.
3+
# Keeps Audit Logs schema docs current with github/audit-log-allowlists.
64

75
on:
86
workflow_dispatch:
@@ -13,7 +11,7 @@ permissions:
1311
contents: write
1412
pull-requests: write
1513

16-
# This allows a subsequently queued workflow run to interrupt previous runs
14+
# Cancel older syncs so stale schema data does not open older PRs.
1715
concurrency:
1816
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
1917
cancel-in-progress: true
@@ -29,7 +27,7 @@ jobs:
2927

3028
- name: Run updater script
3129
env:
32-
# need to use a token from a user with access to github/audit-log-allowlists for this step
30+
# DOCS_BOT_PAT_BASE can read github/audit-log-allowlists.
3331
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
3432
run: |
3533
npm run sync-audit-log
@@ -47,14 +45,12 @@ jobs:
4745
4846
- name: Create and merge pull request
4947
env:
50-
# Needed for gh
5148
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
5249
run: |
5350
echo "Creating a new branch if needed..."
5451
branchname=audit-logs-schema-update-${{ steps.audit-log-allowlists.outputs.COMMIT_SHA }}
5552
remotesha=$(git ls-remote --heads origin $branchname)
5653
if [ -n "$remotesha" ]; then
57-
# output is not empty, it means the remote branch exists
5854
echo "Branch $branchname already exists in 'github/docs-internal'. Exiting..."
5955
exit 0
6056
fi
@@ -94,14 +90,14 @@ jobs:
9490
--head=$branchname
9591
echo "Created pull request"
9692
97-
# can't approve your own PR, approve with Actions
93+
# docs-bot cannot approve its own PR, so GITHUB_TOKEN approves it.
9894
echo "Approving pull request..."
9995
unset GITHUB_TOKEN
10096
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
10197
gh pr review --approve
10298
echo "Approved pull request"
10399
104-
# Actions can't merge the PR so back to docs-bot to merge the PR
100+
# GITHUB_TOKEN cannot enable auto-merge here, so docs-bot enables it.
105101
echo "Setting pull request to auto merge..."
106102
unset GITHUB_TOKEN
107103
gh auth login --with-token <<< "${{ secrets.DOCS_BOT_PAT_BASE }}"

‎.github/workflows/sync-codeql-cli.yml‎

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: Sync CodeQL CLI
22

3-
# **What it does**: This workflow is run manually approximately every two weeks.
4-
# When run, this workflow syncs the CodeQL CLI automated pipeline with the semmle-code
5-
# repository, and creates a pull request if there are updates.
6-
# **Why we have it**: So we can automate CodeQL CLI documentation.
7-
# **Who does it impact**: Anyone making CodeQL CLI changes in `github/semmle-code`, and wanting to get them published on the docs site.
3+
# Updates CodeQL CLI docs from github/semmle-code and opens a PR when files change.
4+
# Run it manually about every two weeks to publish upstream changes.
85

96
on:
107
workflow_dispatch:
@@ -19,7 +16,7 @@ permissions:
1916
contents: write
2017
pull-requests: write
2118

22-
# This allows a subsequently queued workflow run to interrupt previous runs
19+
# Cancel older syncs so stale CodeQL CLI data does not open older PRs.
2320
concurrency:
2421
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
2522
cancel-in-progress: true
@@ -34,8 +31,6 @@ jobs:
3431
- name: Checkout semmle-code repo
3532
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
3633
with:
37-
# By default, only the most recent commit of the `main` branch
38-
# will be checked out
3934
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
4035
repository: github/semmle-code
4136
path: semmle-code
@@ -53,13 +48,9 @@ jobs:
5348
5449
- name: Install pandoc
5550
run: |
56-
# Remove all previous pandoc versions
5751
sudo apt-get purge --auto-remove pandoc
58-
# Download pandoc
5952
wget https://github.com/jgm/pandoc/releases/download/3.0.1/pandoc-3.0.1-1-amd64.deb
60-
# Install pandoc
6153
sudo dpkg -i pandoc-3.0.1-1-amd64.deb
62-
# Output the pandoc version installed
6354
pandoc -v
6455
rm pandoc-3.0.1-1-amd64.deb
6556
@@ -72,10 +63,9 @@ jobs:
7263
7364
- name: Create pull request
7465
env:
75-
# Needed for gh
7666
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
7767
run: |
78-
# If nothing to commit, exit now. It's fine. No orphans.
68+
# Exit before branch creation so a no-op sync does not leave an orphan branch.
7969
changes=$(git diff --name-only | wc -l)
8070
untracked=$(git status --untracked-files --short | wc -l)
8171
if [[ $changes -eq 0 ]] && [[ $untracked -eq 0 ]]; then
@@ -92,13 +82,10 @@ jobs:
9282
git add .
9383
git commit -m "Update CodeQL CLI data"
9484
95-
# Force-push to handle reruns where the branch already exists on the
96-
# remote from a prior failed attempt. Plain --force is safe here
97-
# because these branches are exclusively managed by this workflow.
85+
# Force-push reruns over failed attempts; this workflow exclusively owns these branches.
9886
git push --force -u origin $branchname
9987
100-
# If a PR already exists for this branch (e.g. a previous run
101-
# succeeded but the workflow still reported failure), skip creation.
88+
# Skip PR creation when a prior run already opened one for this branch.
10289
existing_pr=$(gh pr list --repo github/docs-internal --head "$branchname" --json number --jq '.[0].number')
10390
if [[ -n "$existing_pr" ]]; then
10491
echo "Pull request #$existing_pr already exists for branch $branchname. Skipping PR creation."

‎.github/workflows/sync-graphql.yml‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Sync GraphQL schema
22

3-
# **What it does**: This updates our GraphQL schemas.
4-
# **Why we have it**: We want our GraphQL docs up to date.
5-
# **Who does it impact**: Docs engineering, people reading GraphQL docs.
3+
# Keeps GraphQL docs current with schema changes from github/github.
64

75
on:
86
workflow_dispatch:
@@ -30,21 +28,20 @@ jobs:
3028
- name: Run updater scripts
3129
id: sync
3230
env:
33-
# need to use a token from a user with access to github/github for this step
31+
# DOCS_BOT_PAT_BASE can read github/github.
3432
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
3533
NODE_OPTIONS: '--max-old-space-size=8192'
3634
run: npm run sync-graphql
3735
- name: Create pull request
3836
id: create-pull-request
3937
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # pin @v8.0.0
4038
env:
41-
# Disable pre-commit hooks; they don't play nicely here
39+
# Disable Husky because create-pull-request commits inside Actions.
4240
HUSKY: '0'
4341
with:
44-
# Need to use a token with repo and workflow scopes for this step.
45-
# Token should be a PAT because actions performed with GITHUB_TOKEN
46-
# don't trigger other workflows and this action force pushes updates
47-
# from the default branch.
42+
# DOCS_BOT_PAT_BASE has repo and workflow scopes.
43+
# GITHUB_TOKEN does not trigger follow-up workflows.
44+
# create-pull-request force-pushes updates from the default branch.
4845
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
4946
commit-message: 'Update GraphQL data files'
5047
title: GraphQL schema update

‎.github/workflows/sync-llms-txt.yml‎

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
name: Sync llms.txt
22

3-
# **What it does**: Generates docs.github.com/llms.txt, github.com/llms.txt, and
4-
# github.com/llms-full.txt from the page catalog and popularity data, then
5-
# opens PRs to update them.
6-
# **Why we have it**: Agents discover docs through llms.txt; the page list keeps
7-
# pace with what's actually popular without writers updating it by hand.
8-
# **Who does it impact**: Docs consumers via agents, and anyone landing on
9-
# github.com/llms.txt, github.com/llms-full.txt, or docs.github.com/llms.txt.
3+
# Generates docs.github.com/llms.txt, github.com/llms.txt, and github.com/llms-full.txt.
4+
# Uses the page catalog and popularity data, then opens PRs to update them.
105

116
on:
127
workflow_dispatch:
@@ -59,8 +54,6 @@ jobs:
5954
--output /tmp/monolith-llms.txt
6055
echo "Generated monolith llms.txt ($(wc -l < /tmp/monolith-llms.txt) lines, $(wc -c < /tmp/monolith-llms.txt) bytes)"
6156
62-
# ---------- PR to docs-internal: update data/llms-txt/docs.md ----------
63-
6457
- name: Diff docs llms.txt against committed copy
6558
id: diff_docs
6659
run: |
@@ -97,11 +90,8 @@ jobs:
9790
git config user.name "docs-bot"
9891
git config user.email "77750099+docs-bot@users.noreply.github.com"
9992
git add data/llms-txt/docs.md
100-
# diff_docs compares against main, but the sync branch may already
101-
# exist with this exact content (open PR from a prior run). In that
102-
# case there is nothing new to stage, and `git commit` would exit 1
103-
# and fail the whole workflow. Skip the commit and push when the
104-
# branch is already up to date.
93+
# diff_docs compares against main, but an open sync-branch PR can already hold this content.
94+
# Skip commit and push because git commit exits 1 with nothing staged.
10595
if git diff --cached --quiet; then
10696
echo "Sync branch already has the latest generated docs.md; nothing to commit."
10797
else
@@ -135,8 +125,6 @@ jobs:
135125
--draft \
136126
--label "llm-generated"
137127
138-
# ---------- PR to github/github: update public/llms*.txt ----------
139-
140128
- name: Fetch current public llms files from github/github
141129
id: fetch_monolith
142130
env:

‎.github/workflows/sync-openapi.yml‎

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Sync OpenAPI schema
22

3-
# **What it does**: Syncs the REST, Webhooks, and GitHub Apps automated pipelines with the github/rest-api-description repository, and creates a pull request if there are updates to any of the data files we generate from the OpenAPI. Runs on a weekday schedule or a `sync-openapi` repository dispatch.
4-
# **Why we have it**: So we can automate updates to REST, Webhooks, and GitHub Apps documentation
5-
# **Who does it impact**: Anyone making OpenAPI changes in `github/github`, and wanting to get them published on the docs site.
3+
# Updates REST, Webhooks, and GitHub Apps docs from github/rest-api-description.
4+
# Opens a PR when generated OpenAPI data files change.
65

76
on:
87
workflow_dispatch:
@@ -21,7 +20,7 @@ permissions:
2120
contents: write
2221
pull-requests: write
2322

24-
# This allows a subsequently queued workflow run to interrupt previous runs
23+
# Cancel older syncs so stale OpenAPI data does not open older PRs.
2524
concurrency:
2625
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
2726
cancel-in-progress: true
@@ -34,12 +33,9 @@ jobs:
3433
- name: Checkout repository code
3534
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
3635

37-
# Check out a nested repository inside of previous checkout
3836
- name: Checkout rest-api-description repo
3937
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
4038
with:
41-
# By default, only the most recent commit of the `main` branch
42-
# will be checked out
4339
repository: github/rest-api-description
4440
path: rest-api-description
4541
ref: ${{ inputs.SOURCE_BRANCH || github.event.client_payload.ref || 'main' }}
@@ -48,7 +44,6 @@ jobs:
4844

4945
- name: Sync the REST, Webhooks, and GitHub Apps schemas
5046
env:
51-
# Needed for gh
5247
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
5348
NODE_OPTIONS: '--max-old-space-size=8192'
5449
run: |
@@ -72,10 +67,9 @@ jobs:
7267
7368
- name: Create pull request
7469
env:
75-
# Needed for gh
7670
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
7771
run: |
78-
# If nothing to commit, exit now. It's fine. No orphans.
72+
# Exit before branch creation so a no-op sync does not leave an orphan branch.
7973
changes=$(git diff --name-only | wc -l)
8074
if [[ $changes -eq 0 ]]; then
8175
echo "There are no changes to commit after running 'npm run sync-rest'. Exiting..."
@@ -89,7 +83,6 @@ jobs:
8983
9084
remotesha=$(git ls-remote --heads origin $branchname)
9185
if [ -n "$remotesha" ]; then
92-
# output is not empty, it means the remote branch exists
9386
echo "Branch $branchname already exists in 'github/docs-internal'. Exiting..."
9487
exit 0
9588
fi

0 commit comments

Comments
 (0)