Skip to content

Commit 1a1b1a8

Browse files
committed
Merge remote-tracking branch 'upstream/main' into gh-145742-work
2 parents 76b642d + 1f36a51 commit 1a1b1a8

Some content is hidden

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

53 files changed

+740
-372
lines changed

.github/workflows/reusable-check-c-api-docs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ name: Reusable C API Docs Check
33
on:
44
workflow_call:
55

6-
permissions:
7-
contents: read
6+
permissions: {}
87

98
env:
109
FORCE_COLOR: 1

.github/workflows/reusable-check-html-ids.yml

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ name: Reusable check HTML IDs
33
on:
44
workflow_call:
55

6-
permissions:
7-
contents: read
6+
permissions: {}
87

98
env:
109
FORCE_COLOR: 1
@@ -15,36 +14,45 @@ jobs:
1514
runs-on: ubuntu-latest
1615
timeout-minutes: 30
1716
steps:
18-
- name: 'Check out base commit'
17+
- name: 'Check out PR head'
1918
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2019
with:
2120
persist-credentials: false
22-
ref: ${{ github.event.pull_request.base.sha }}
21+
ref: ${{ github.event.pull_request.head.sha }}
22+
- name: 'Find merge base'
23+
id: merge-base
24+
run: |
25+
BASE="${{ github.event.pull_request.base.sha }}"
26+
HEAD="${{ github.event.pull_request.head.sha }}"
27+
git fetch --depth=$((${{ github.event.pull_request.commits }} + 10)) --no-tags origin "$BASE" "$HEAD"
28+
29+
if ! MERGE_BASE=$(git merge-base "$BASE" "$HEAD" 2>/dev/null); then
30+
git fetch --deepen=1 --no-tags origin "$BASE" "$HEAD"
31+
32+
OLDEST=$(git rev-list --reflog --max-parents=0 --reverse "${BASE}^" "${HEAD}^" | head -1)
33+
TIMESTAMP=$(git show --format=%at --no-patch "$OLDEST")
34+
35+
git fetch --shallow-since="$TIMESTAMP" --no-tags origin "$BASE" "$HEAD"
36+
37+
MERGE_BASE=$(git merge-base "$BASE" "$HEAD")
38+
fi
39+
echo "sha=$MERGE_BASE" >> "$GITHUB_OUTPUT"
40+
- name: 'Create worktree at merge base'
41+
env:
42+
MERGE_BASE: ${{ steps.merge-base.outputs.sha }}
43+
run: git worktree add /tmp/merge-base "$MERGE_BASE" --detach
2344
- name: 'Set up Python'
2445
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2546
with:
2647
python-version: '3'
2748
cache: 'pip'
2849
cache-dependency-path: 'Doc/requirements.txt'
2950
- name: 'Install build dependencies'
30-
run: make -C Doc/ venv
51+
run: make -C /tmp/merge-base/Doc/ venv
3152
- name: 'Build HTML documentation'
32-
run: make -C Doc/ SPHINXOPTS="--quiet" html
33-
- name: 'Check out PR head tools'
34-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
35-
with:
36-
persist-credentials: false
37-
sparse-checkout: |
38-
Doc/tools/check-html-ids.py
39-
Doc/tools/removed-ids.txt
40-
sparse-checkout-cone-mode: false
41-
path: pr-head
42-
- name: 'Use PR head tools'
43-
run: |
44-
cp pr-head/Doc/tools/check-html-ids.py Doc/tools/check-html-ids.py
45-
[ -f pr-head/Doc/tools/removed-ids.txt ] && cp pr-head/Doc/tools/removed-ids.txt Doc/tools/removed-ids.txt
53+
run: make -C /tmp/merge-base/Doc/ SPHINXOPTS="--quiet" html
4654
- name: 'Collect HTML IDs'
47-
run: python Doc/tools/check-html-ids.py collect Doc/build/html -o /tmp/html-ids-base.json.gz
55+
run: python Doc/tools/check-html-ids.py collect /tmp/merge-base/Doc/build/html -o /tmp/html-ids-base.json.gz
4856
- name: 'Download PR head HTML IDs'
4957
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
5058
with:

.github/workflows/reusable-cifuzz.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
required: true
1414
type: string
1515

16+
permissions: {}
17+
1618
jobs:
1719
cifuzz:
1820
name: ${{ inputs.oss-fuzz-project-name }} (${{ inputs.sanitizer }})

.github/workflows/reusable-context.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ on: # yamllint disable-line rule:truthy
5454
description: Whether to run the Windows tests
5555
value: ${{ jobs.compute-changes.outputs.run-windows-tests }} # bool
5656

57+
permissions: {}
58+
5759
jobs:
5860
compute-changes:
5961
name: Create context from changed files

.github/workflows/reusable-docs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ on:
44
workflow_call:
55
workflow_dispatch:
66

7-
permissions:
8-
contents: read
7+
permissions: {}
98

109
concurrency:
1110
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.github/workflows/reusable-emscripten.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Reusable Emscripten
33
on:
44
workflow_call:
55

6+
permissions: {}
7+
68
env:
79
FORCE_COLOR: 1
810

.github/workflows/reusable-macos.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ on:
1212
required: true
1313
type: string
1414

15+
permissions: {}
16+
1517
env:
1618
FORCE_COLOR: 1
1719

.github/workflows/reusable-san.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ on:
1212
type: boolean
1313
default: false
1414

15+
permissions: {}
16+
1517
env:
1618
FORCE_COLOR: 1
1719

.github/workflows/reusable-ubuntu.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ on:
2323
type: string
2424
default: ''
2525

26+
permissions: {}
27+
2628
env:
2729
FORCE_COLOR: 1
2830

.github/workflows/reusable-wasi.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Reusable WASI
33
on:
44
workflow_call:
55

6+
permissions: {}
7+
68
env:
79
FORCE_COLOR: 1
810

0 commit comments

Comments
 (0)