Skip to content

Commit 3a444c0

Browse files
authored
Merge pull request #46392 from github/repo-sync
Repo sync
2 parents 44a609d + 24f0601 commit 3a444c0

302 files changed

Lines changed: 5722 additions & 1459 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.

‎.devcontainer/Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Update ARG and FROM together from the Node devcontainer image tags:
22
# https://mcr.microsoft.com/en-us/product/devcontainers/javascript-node/tags
33
ARG VARIANT=dev-24-bookworm
4-
FROM mcr.microsoft.com/devcontainers/javascript-node:dev-24-bookworm@sha256:5ed0bf1411cffe8182ee6808477dd64c969a4ce78fee1b63e6a654d7deff889c
4+
FROM mcr.microsoft.com/devcontainers/javascript-node:dev-24-bookworm@sha256:d0445b9546f96869b509aa70b8593bdc0054aca6689bc1dd0324083d0fd2bcc3

‎.github/actions/labeler/labeler.ts‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,8 @@ if (import.meta.url.endsWith(process.argv[1])) {
3131
ignoreIfLabeled: boolEnvVar('IGNORE_IF_LABELED'),
3232
}
3333

34-
// Actions pass comma-separated labels.
35-
if (typeof ADD_LABELS === 'string') {
36-
opts.addLabels = [...ADD_LABELS.split(',')].map((l) => l.trim())
37-
} else {
38-
opts.addLabels = []
39-
}
40-
if (typeof REMOVE_LABELS === 'string') {
41-
opts.removeLabels = [...REMOVE_LABELS.split(',')].map((l) => l.trim())
42-
} else {
43-
opts.removeLabels = []
44-
}
34+
opts.addLabels = parseLabels(ADD_LABELS)
35+
opts.removeLabels = parseLabels(REMOVE_LABELS)
4536

4637
const actionContext = getActionContext()
4738
const { owner, repo } = actionContext
@@ -58,6 +49,14 @@ if (import.meta.url.endsWith(process.argv[1])) {
5849
main(coreLib, octokit, opts)
5950
}
6051

52+
// Actions pass comma-separated labels, and an omitted input arrives as an empty string.
53+
export function parseLabels(value?: string): string[] {
54+
return (value || '')
55+
.split(',')
56+
.map((l) => l.trim())
57+
.filter(Boolean)
58+
}
59+
6160
export default async function main(
6261
core: typeof coreLib | CoreInject,
6362
octokit: Octokit,

‎.github/dependabot.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ updates:
2323
['version-update:semver-patch', 'version-update:semver-minor']
2424

2525
- package-ecosystem: 'github-actions'
26-
directory: '/'
26+
directories:
27+
- '/'
28+
- '/.github/actions/*'
2729
schedule:
2830
interval: weekly
2931
day: tuesday

‎.github/workflows/auto-close-dependencies.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- 'Gemfile*'
1010
- 'Dockerfile'
1111
- '.github/workflows/**'
12+
- '.github/actions/**'
1213

1314
permissions:
1415
contents: write

‎.github/workflows/changelog-agent.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,12 @@ jobs:
227227
const prNumber = parseInt('${{ steps.resolve_pr.outputs.pr_number }}', 10);
228228
const prAuthor = '${{ steps.resolve_pr.outputs.pr_author }}';
229229
230-
const { data: reviews } = await github.rest.pulls.listReviews({
230+
// Approvals often come after many comment reviews, so read every page
231+
const reviews = await github.paginate(github.rest.pulls.listReviews, {
231232
owner: context.repo.owner,
232233
repo: context.repo.repo,
233234
pull_number: prNumber,
235+
per_page: 100,
234236
});
235237
236238
const approvedReviewers = [...new Set(

‎.github/workflows/codeql.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ jobs:
3232
with:
3333
languages: javascript
3434
- uses: github/codeql-action/analyze@e296a935590eb16afc0c0108289f68c87e2a89a5 # v4.30.7
35-
continue-on-error: true
35+
# Pull request scans stay non-blocking so analysis errors do not hold up merges.
36+
# Push runs must fail so the alert steps below fire.
37+
continue-on-error: ${{ github.event_name == 'pull_request' }}
3638

3739
- uses: ./.github/actions/create-workflow-failure-issue
3840
id: create-failure-issue

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ name: Confirm internal staff meant to post in public
44

55
on:
66
issues:
7+
# Issues moved into github/docs arrive as opened. The transferred event fires in the source repo.
78
types:
89
- opened
9-
- transferred
1010
# pull_request_target lets the workflow check org membership for forked PR authors.
1111
pull_request_target:
1212
types:

‎.github/workflows/dont-delete-assets.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ jobs:
4444

4545
- name: Update comment
4646
if: ${{ steps.comment.outputs.markdown != '' }}
47+
# Fork PRs get a read-only token, so posting fails there. The next step still shows the instructions.
48+
continue-on-error: true
4749
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9
4850
with:
4951
comment-id: ${{ steps.findComment.outputs.comment-id }}
@@ -53,7 +55,11 @@ jobs:
5355

5456
- name: Ultimately fail the workflow for attention
5557
if: ${{ steps.comment.outputs.markdown != '' }}
58+
env:
59+
MARKDOWN: ${{ steps.comment.outputs.markdown }}
5660
run: |
5761
echo "More than 1 asset image was deleted as part of this PR."
58-
echo "See posted PR commented about how to get them back."
62+
echo "See the PR comment or this job's summary for how to get them back."
63+
echo "$MARKDOWN" >> "$GITHUB_STEP_SUMMARY"
64+
echo "$MARKDOWN"
5965
exit 1

‎.github/workflows/dont-delete-features.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242

4343
- name: Update comment
4444
if: ${{ steps.comment.outputs.markdown != '' }}
45+
# Fork PRs get a read-only token, so posting fails there. The next step still shows the instructions.
46+
continue-on-error: true
4547
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9
4648
with:
4749
comment-id: ${{ steps.findComment.outputs.comment-id }}
@@ -51,7 +53,11 @@ jobs:
5153

5254
- name: Ultimately fail the workflow for attention
5355
if: ${{ steps.comment.outputs.markdown != '' }}
56+
env:
57+
MARKDOWN: ${{ steps.comment.outputs.markdown }}
5458
run: |
5559
echo "This PR deletes or renames one or more feature files."
56-
echo "See the PR comment for how to get them back."
60+
echo "See the PR comment or this job's summary for how to get them back."
61+
echo "$MARKDOWN" >> "$GITHUB_STEP_SUMMARY"
62+
echo "$MARKDOWN"
5763
exit 1

‎.github/workflows/generate-code-scanning-query-lists.yml‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ jobs:
152152
create-pull-request:
153153
if: github.repository == 'github/docs-internal'
154154
runs-on: ubuntu-latest
155+
# Serialize publishing so a second run sees the first run's PR before it force-pushes.
156+
# Pull request dry runs get their own group so they never queue behind or cancel a publisher.
157+
concurrency:
158+
group: ${{ github.workflow }}-query-table-publication-${{ github.event_name == 'pull_request' && github.run_id || 'publish' }}
159+
cancel-in-progress: false
155160
permissions:
156161
contents: write
157162
pull-requests: write
@@ -216,27 +221,27 @@ jobs:
216221
217222
branchname=codeql-query-tables-${{ steps.codeql.outputs.OPENAPI_COMMIT_SHA }}
218223
219-
# Query the remote because actions/checkout with fetch-depth 1 omits other remote-tracking branches.
220-
branchExists=$(git ls-remote --heads origin refs/heads/$branchname | wc -l)
221-
222224
# Pull request runs validate generated files without pushing branches.
223225
if [ "$DRY_RUN" = "true" ]; then
224226
echo "Dry-run mode when run in a pull request"
225227
echo "See the 'Insight into diff' step for the changes it would create PR about."
226228
exit 0
227229
fi
228230
229-
if [ $branchExists -ne 0 ]; then
230-
echo "Branch $branchname already exists in the remote repository."
231+
# Check for an open PR before pushing so reruns do not overwrite commits added to it.
232+
existing_pr=$(gh pr list --repo github/docs-internal --head "$branchname" --json number --jq '.[0].number')
233+
if [[ -n "$existing_pr" ]]; then
234+
echo "Pull request #$existing_pr already exists for branch $branchname. Skipping PR creation."
231235
exit 0
232-
else
233-
git checkout -b $branchname
234236
fi
235237
238+
git checkout -b $branchname
236239
git add data/reusables/code-scanning/codeql-query-tables
237240
git add data/reusables/code-quality/codeql-query-tables
238241
git commit -m "Update CodeQL query tables"
239-
git push -u origin $branchname
242+
243+
# Force-push over a branch left by a failed attempt; this workflow exclusively owns these branches.
244+
git push --force -u origin $branchname
240245
241246
echo "Creating pull request..."
242247
gh pr create \

0 commit comments

Comments
 (0)