Skip to content

Commit a1a7345

Browse files
authored
ci: call docs update workflow from release (#933)
- replace the docs update tag-push trigger with manual and reusable workflow entrypoints - call the docs update reusable workflow after publishing a release - keep manual docs updates available by selecting the latest semver tag Refs: pi-session 019f2352-565c-7f60-b96b-f2546fb1690f
1 parent a5e9cbf commit a1a7345

2 files changed

Lines changed: 33 additions & 4 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,14 @@ jobs:
111111
112112
echo "Publishing draft release $TAG"
113113
gh release edit "$TAG" --draft=false
114+
115+
update-docs:
116+
name: Update docs
117+
needs:
118+
- release
119+
uses: ./.github/workflows/update-docs.yml
120+
permissions:
121+
contents: write
122+
pull-requests: write
123+
with:
124+
tag: v${{ inputs.version }}

‎.github/workflows/update-docs.yml‎

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,46 @@
11
name: "Update docs"
22
on:
3-
push:
4-
tags:
5-
- "v*.*.*"
3+
workflow_call:
4+
inputs:
5+
tag:
6+
description: "Release tag to update docs for (e.g., v8.2.0)"
7+
required: true
8+
type: string
9+
workflow_dispatch:
610

711
permissions: {}
812

913
jobs:
1014
update-docs:
15+
continue-on-error: ${{ github.event_name == 'workflow_call' }}
1116
runs-on: ubuntu-24.04-arm
1217
permissions:
1318
contents: write
1419
pull-requests: write
1520
steps:
1621
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1722
with:
23+
fetch-depth: 0
1824
persist-credentials: true
1925
- name: Get tag info
2026
id: tag-info
2127
run: |
22-
TAG_NAME="${GITHUB_REF#refs/tags/}"
28+
if [ -n "$INPUT_TAG" ]; then
29+
TAG_NAME="$INPUT_TAG"
30+
else
31+
TAG_NAME=$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1)
32+
fi
33+
34+
if [[ ! "$TAG_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
35+
echo "::error::Tag must match vMAJOR.MINOR.PATCH (e.g., v8.2.0)"
36+
exit 1
37+
fi
38+
2339
COMMIT_SHA=$(git rev-list -n 1 "$TAG_NAME")
2440
echo "tag=$TAG_NAME" >> "$GITHUB_OUTPUT"
2541
echo "sha=$COMMIT_SHA" >> "$GITHUB_OUTPUT"
42+
env:
43+
INPUT_TAG: ${{ inputs.tag }}
2644
- name: Update references in docs
2745
run: |
2846
OLD_REF=$(grep -oh 'astral-sh/setup-uv@[a-f0-9]\{40\} # v[0-9][^ ]*' README.md docs/*.md | head -1)

0 commit comments

Comments
 (0)