Skip to content

Commit c83c731

Browse files
committed
Final polishment
1 parent 6abec8f commit c83c731

3 files changed

Lines changed: 10 additions & 39 deletions

File tree

.github/workflows/manual_release_docs.yaml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@ name: Release docs
33
on:
44
# Runs when manually triggered from the GitHub UI.
55
workflow_dispatch:
6-
inputs:
7-
ref:
8-
description: Git ref to checkout (branch, tag, or SHA). Defaults to the default branch.
9-
required: false
10-
type: string
11-
default: ""
126

137
# Runs when invoked by another workflow.
148
workflow_call:
159
inputs:
1610
ref:
17-
description: Git ref to checkout (branch, tag, or SHA)
11+
description: Git ref to checkout.
1812
required: true
1913
type: string
2014

@@ -37,20 +31,11 @@ jobs:
3731
runs-on: ubuntu-latest
3832

3933
steps:
40-
- name: Determine checkout ref
41-
id: resolve_ref
42-
env:
43-
INPUT_REF: ${{ inputs.ref }}
44-
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
45-
run: |
46-
REF="${INPUT_REF:-$DEFAULT_BRANCH}"
47-
echo "ref=$REF" >> "$GITHUB_OUTPUT"
48-
4934
- name: Checkout repository
5035
uses: actions/checkout@v6
5136
with:
5237
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
53-
ref: ${{ steps.resolve_ref.outputs.ref }}
38+
ref: ${{ inputs.ref || github.event.repository.default_branch }}
5439

5540
- name: Set up Node
5641
uses: actions/setup-node@v6
@@ -79,7 +64,7 @@ jobs:
7964
add: website/package.json website/yarn.lock
8065
message: "chore: Automatic docs theme update [skip ci]"
8166
default_author: github_actions
82-
# Required: checkout may leave a detached HEAD when invoked with a SHA ref.
67+
# `actions/checkout` detaches HEAD on SHA refs; EndBug needs a branch to push.
8368
new_branch: ${{ github.event.repository.default_branch }}
8469

8570
- 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,7 +122,7 @@ 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
127128

.github/workflows/manual_version_docs.yaml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,17 @@ name: Version docs
33
on:
44
# Runs when manually triggered from the GitHub UI.
55
workflow_dispatch:
6-
inputs:
7-
ref:
8-
description: Git ref to checkout (branch, tag, or SHA). Defaults to the default branch.
9-
required: false
10-
type: string
11-
default: ""
126

137
# Runs when invoked by another workflow.
148
workflow_call:
159
inputs:
1610
ref:
17-
description: Git ref to checkout (branch, tag, or SHA)
11+
description: Git ref to checkout.
1812
required: true
1913
type: string
2014
outputs:
2115
version_docs_commitish:
22-
description: The commit SHA of the versioned docs commit
16+
description: The commit SHA of the versioned docs commit.
2317
value: ${{ jobs.version_docs.outputs.version_docs_commitish }}
2418

2519
concurrency:
@@ -43,20 +37,11 @@ jobs:
4337
contents: write
4438

4539
steps:
46-
- name: Determine checkout ref
47-
id: resolve_ref
48-
env:
49-
INPUT_REF: ${{ inputs.ref }}
50-
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
51-
run: |
52-
REF="${INPUT_REF:-$DEFAULT_BRANCH}"
53-
echo "ref=$REF" >> "$GITHUB_OUTPUT"
54-
5540
- name: Checkout repository
5641
uses: actions/checkout@v6
5742
with:
5843
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
59-
ref: ${{ steps.resolve_ref.outputs.ref }}
44+
ref: ${{ inputs.ref || github.event.repository.default_branch }}
6045

6146
- name: Set up Node
6247
uses: actions/setup-node@v6
@@ -123,7 +108,7 @@ jobs:
123108
add: website/versioned_docs website/versioned_sidebars website/versions.json
124109
message: "docs: Version docs for v${{ steps.snapshot.outputs.version }} [skip ci]"
125110
default_author: github_actions
126-
# Required: checkout may leave a detached HEAD when invoked with a SHA ref.
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)