Skip to content

Commit aff224f

Browse files
vdusekclaude
andcommitted
ci: Extract docs release into reusable manual_release_docs.yaml workflow
Match the structure of `manual_version_docs.yaml` so it can be triggered both from the GitHub UI (with an optional ref input) and from other workflows. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d444efb commit aff224f

3 files changed

Lines changed: 22 additions & 7 deletions

File tree

.github/workflows/_release_docs.yaml renamed to .github/workflows/manual_release_docs.yaml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1-
name: Doc release
1+
name: Release docs
22

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: ""
612

713
# Runs when invoked by another workflow.
814
workflow_call:
915
inputs:
1016
ref:
17+
description: Git ref to checkout (branch, tag, or SHA)
1118
required: true
1219
type: string
1320

1421
env:
1522
NODE_VERSION: 22
1623
PYTHON_VERSION: 3.14
17-
CHECKOUT_REF: ${{ github.event_name == 'workflow_call' && inputs.ref || github.ref }}
1824

1925
jobs:
2026
release_docs:
21-
name: Doc release
27+
name: Release docs
2228
environment:
2329
name: github-pages
2430
permissions:
@@ -28,11 +34,20 @@ jobs:
2834
runs-on: ubuntu-latest
2935

3036
steps:
37+
- name: Determine checkout ref
38+
id: resolve_ref
39+
env:
40+
INPUT_REF: ${{ inputs.ref }}
41+
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
42+
run: |
43+
REF="${INPUT_REF:-$DEFAULT_BRANCH}"
44+
echo "ref=$REF" >> "$GITHUB_OUTPUT"
45+
3146
- name: Checkout repository
3247
uses: actions/checkout@v6
3348
with:
3449
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
35-
ref: ${{ env.CHECKOUT_REF }}
50+
ref: ${{ steps.resolve_ref.outputs.ref }}
3651

3752
- name: Set up Node
3853
uses: actions/setup-node@v6

.github/workflows/manual_release_stable.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
contents: write
120120
pages: write
121121
id-token: write
122-
uses: ./.github/workflows/_release_docs.yaml
122+
uses: ./.github/workflows/manual_release_docs.yaml
123123
with:
124124
# Use the version_docs commit to include both changelog and versioned docs.
125125
ref: ${{ needs.version_docs.outputs.version_docs_commitish }}

.github/workflows/on_master.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
contents: write
2929
pages: write
3030
id-token: write
31-
uses: ./.github/workflows/_release_docs.yaml
31+
uses: ./.github/workflows/manual_release_docs.yaml
3232
with:
3333
# Use the same ref as the one that triggered the workflow.
3434
ref: ${{ github.ref }}
@@ -112,7 +112,7 @@ jobs:
112112
contents: write
113113
pages: write
114114
id-token: write
115-
uses: ./.github/workflows/_release_docs.yaml
115+
uses: ./.github/workflows/manual_release_docs.yaml
116116
with:
117117
# Use the ref from the changelog update to include the updated changelog.
118118
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}

0 commit comments

Comments
 (0)