Skip to content

Commit 06d4127

Browse files
committed
Final polishment
1 parent 6a414fc commit 06d4127

3 files changed

Lines changed: 14 additions & 43 deletions

File tree

.github/workflows/manual_release_docs.yaml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
name: Release docs
22

33
on:
4-
# Runs when manually triggered from the GitHub UI. Always checks out the default branch —
5-
# this workflow pushes a theme-update commit back to the default branch, so the checked-out
6-
# ref must be its current tip to avoid non-fast-forward pushes.
4+
# Runs when manually triggered from the GitHub UI.
75
workflow_dispatch:
86

9-
# Runs when invoked by another workflow. The caller is responsible for passing a ref that's
10-
# on the default branch tip (e.g. a freshly pushed commit protected by `concurrency: release`).
7+
# Runs when invoked by another workflow.
118
workflow_call:
129
inputs:
1310
ref:
14-
description: Git ref to checkout (must resolve to the default branch tip).
11+
description: Git ref to checkout.
1512
required: true
1613
type: string
1714

@@ -31,20 +28,11 @@ jobs:
3128
runs-on: ubuntu-latest
3229

3330
steps:
34-
- name: Determine checkout ref
35-
id: resolve_ref
36-
env:
37-
INPUT_REF: ${{ inputs.ref }}
38-
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
39-
run: |
40-
REF="${INPUT_REF:-$DEFAULT_BRANCH}"
41-
echo "ref=$REF" >> "$GITHUB_OUTPUT"
42-
4331
- name: Checkout repository
4432
uses: actions/checkout@v6
4533
with:
4634
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
47-
ref: ${{ steps.resolve_ref.outputs.ref }}
35+
ref: ${{ inputs.ref || github.event.repository.default_branch }}
4836

4937
- name: Set up Node
5038
uses: actions/setup-node@v6
@@ -73,10 +61,7 @@ jobs:
7361
add: website/package.json website/yarn.lock
7462
message: "chore: Automatic docs theme update [skip ci]"
7563
default_author: github_actions
76-
# Required: `actions/checkout` leaves a detached HEAD when invoked with a SHA ref.
77-
# Creating a local default-branch pointer at HEAD lets EndBug push it back. The caller
78-
# contract (see trigger definitions above) guarantees HEAD is the default branch tip,
79-
# so this push is always a fast-forward.
64+
# `actions/checkout` detaches HEAD on SHA refs; EndBug needs a branch to push.
8065
new_branch: ${{ github.event.repository.default_branch }}
8166

8267
- name: Build docs

.github/workflows/manual_release_stable.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
version_number: ${{ needs.release_prepare.outputs.version_number }}
9999
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
100100

101-
# Publishes the package to PyPI using PyPA official GitHub action with OIDC authentication.
101+
# Publish the package to PyPI using PyPA official GitHub action with OIDC authentication.
102102
- name: Publish package to PyPI
103103
uses: pypa/gh-action-pypi-publish@release/v1
104104

@@ -109,6 +109,7 @@ jobs:
109109
contents: write
110110
uses: ./.github/workflows/manual_version_docs.yaml
111111
with:
112+
# Commit the version docs changes on top of the changelog commit.
112113
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
113114
secrets: inherit
114115

@@ -121,6 +122,6 @@ jobs:
121122
id-token: write
122123
uses: ./.github/workflows/manual_release_docs.yaml
123124
with:
124-
# Use the version_docs commit to include both changelog and versioned docs.
125+
# Commit the docs release changes on top of the version docs commit.
125126
ref: ${{ needs.version_docs.outputs.version_docs_commitish }}
126127
secrets: inherit

.github/workflows/manual_version_docs.yaml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
name: Version docs
22

33
on:
4-
# Runs when manually triggered from the GitHub UI. Always checks out the default branch —
5-
# this workflow pushes the version snapshot commit back to the default branch, so the
6-
# checked-out ref must be its current tip to avoid non-fast-forward pushes.
4+
# Runs when manually triggered from the GitHub UI.
75
workflow_dispatch:
86

9-
# Runs when invoked by another workflow. The caller is responsible for passing a ref that's
10-
# on the default branch tip (e.g. a freshly pushed commit protected by `concurrency: release`).
7+
# Runs when invoked by another workflow.
118
workflow_call:
129
inputs:
1310
ref:
14-
description: Git ref to checkout (must resolve to the default branch tip).
11+
description: Git ref to checkout.
1512
required: true
1613
type: string
1714
outputs:
1815
version_docs_commitish:
19-
description: The commit SHA of the versioned docs commit
16+
description: The commit SHA of the versioned docs commit.
2017
value: ${{ jobs.version_docs.outputs.version_docs_commitish }}
2118

2219
concurrency:
@@ -40,20 +37,11 @@ jobs:
4037
contents: write
4138

4239
steps:
43-
- name: Determine checkout ref
44-
id: resolve_ref
45-
env:
46-
INPUT_REF: ${{ inputs.ref }}
47-
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
48-
run: |
49-
REF="${INPUT_REF:-$DEFAULT_BRANCH}"
50-
echo "ref=$REF" >> "$GITHUB_OUTPUT"
51-
5240
- name: Checkout repository
5341
uses: actions/checkout@v6
5442
with:
5543
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
56-
ref: ${{ steps.resolve_ref.outputs.ref }}
44+
ref: ${{ inputs.ref || github.event.repository.default_branch }}
5745

5846
- name: Set up Node
5947
uses: actions/setup-node@v6
@@ -120,10 +108,7 @@ jobs:
120108
add: website/versioned_docs website/versioned_sidebars website/versions.json
121109
message: "docs: Version docs for v${{ steps.snapshot.outputs.version }} [skip ci]"
122110
default_author: github_actions
123-
# Required: `actions/checkout` leaves a detached HEAD when invoked with a SHA ref.
124-
# Creating a local default-branch pointer at HEAD lets EndBug push it back. The caller
125-
# contract (see trigger definitions above) guarantees HEAD is the default branch tip,
126-
# so this push is always a fast-forward.
111+
# `actions/checkout` detaches HEAD on SHA refs; EndBug needs a branch to push.
127112
new_branch: ${{ github.event.repository.default_branch }}
128113

129114
- name: Resolve output commitish

0 commit comments

Comments
 (0)