11name : Version docs
22
33on :
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
2219concurrency :
@@ -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