File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change 1515 - release
1616 - prerelease
1717 default : " prerelease"
18- prerelease_ref :
19- description : " The ref (branch, tag, or SHA) to checkout and release from (prerelease only) "
20- required : false
18+ ref :
19+ description : " The ref (branch, tag, or SHA) to checkout and release from"
20+ required : true
2121 type : string
2222 prerelease_tag :
2323 description : " The npm dist-tag for the prerelease (e.g., 'v4-prerelease')"
5353 uses : actions/checkout@v4
5454 with :
5555 fetch-depth : 0
56- ref : main
56+ ref : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ref || github.sha }}
57+
58+ - name : Verify ref is on main
59+ if : github.event_name == 'workflow_dispatch'
60+ run : |
61+ if ! git merge-base --is-ancestor ${{ github.event.inputs.ref }} origin/main; then
62+ echo "Error: ref must be an ancestor of main (i.e., already merged)"
63+ exit 1
64+ fi
5765
5866 - name : Setup pnpm
5967 uses : pnpm/action-setup@v4
@@ -121,11 +129,11 @@ jobs:
121129 uses : actions/checkout@v4
122130 with :
123131 fetch-depth : 0
124- ref : ${{ github.event.inputs.prerelease_ref }}
132+ ref : ${{ github.event.inputs.ref }}
125133
126- - name : Validate ref is on main
134+ - name : Verify ref is on main
127135 run : |
128- if ! git merge-base --is-ancestor ${{ github.event.inputs.prerelease_ref }} origin/main; then
136+ if ! git merge-base --is-ancestor ${{ github.event.inputs.ref }} origin/main; then
129137 echo "Error: ref must be an ancestor of main (i.e., already merged)"
130138 exit 1
131139 fi
You can’t perform that action at this time.
0 commit comments