File tree Expand file tree Collapse file tree 2 files changed +24
-6
lines changed
Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 1010 push :
1111 tags : ['v*']
1212 workflow_dispatch :
13+ inputs :
14+ ref :
15+ description : ' Git ref to build docs from (tag or branch)'
16+ required : false
17+ type : string
1318
1419permissions :
1520 contents : read
@@ -31,17 +36,20 @@ jobs:
3136 steps :
3237 - uses : actions/checkout@v4
3338 with :
34- # For workflow_run, checkout the commit that triggered CI
35- ref : ${{ github.event.workflow_run.head_sha || github.ref }}
39+ # Priority: workflow_dispatch input > workflow_run commit > current ref
40+ ref : ${{ inputs.ref || github.event.workflow_run.head_sha || github.ref }}
3641
3742 - name : Install uv
3843 uses : astral-sh/setup-uv@v4
3944
4045 - name : Determine version
4146 id : version
4247 run : |
43- if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
44- VERSION="${GITHUB_REF#refs/tags/v}"
48+ # Check input ref first (from workflow_dispatch), then GITHUB_REF
49+ REF="${{ inputs.ref || github.ref }}"
50+ if [[ "$REF" == refs/tags/v* ]] || [[ "$REF" == v* ]]; then
51+ VERSION="${REF#refs/tags/}"
52+ VERSION="${VERSION#v}"
4553 else
4654 VERSION="latest"
4755 fi
7179 - name : Determine version
7280 id : version
7381 run : |
74- if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
75- VERSION="${GITHUB_REF#refs/tags/v}"
82+ REF="${{ inputs.ref || github.ref }}"
83+ if [[ "$REF" == refs/tags/v* ]] || [[ "$REF" == v* ]]; then
84+ VERSION="${REF#refs/tags/}"
85+ VERSION="${VERSION#v}"
7686 else
7787 VERSION="latest"
7888 fi
Original file line number Diff line number Diff line change 3434
3535permissions :
3636 contents : write
37+ actions : write # Required to trigger docs workflow
3738
3839jobs :
3940 prepare-version :
@@ -202,3 +203,10 @@ jobs:
202203 fi
203204 env :
204205 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
206+
207+ - name : Trigger docs build
208+ run : |
209+ VERSION="${{ needs.prepare-version.outputs.version }}"
210+ gh workflow run docs.yml -f ref="v$VERSION"
211+ env :
212+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments