Skip to content

Commit ffa6895

Browse files
fix(ci): release v4.x from the dispatched branch instead of a branch input (#1676)
1 parent a248977 commit ffa6895

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/prod-release.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ on:
1414
description: 'NPM distribution tag'
1515
required: false
1616
default: 'latest'
17-
branch:
18-
description: 'The branch to release from'
19-
required: false
20-
default: 'master'
2117

2218
env:
2319
NODE_OPTIONS: "--max-old-space-size=4096"
@@ -32,6 +28,12 @@ jobs:
3228
runs-on: ubuntu-latest
3329
needs: [pre-release-ci]
3430
steps:
31+
- name: Require a branch
32+
if: github.ref_type != 'branch'
33+
run: |
34+
echo "::error::Dispatch this workflow from a branch (got ${{ github.ref_type }} '${{ github.ref_name }}'). To release a specific commit, point a branch at it first."
35+
exit 1
36+
3537
- name: Checkout code
3638
uses: actions/checkout@v4
3739
with:
@@ -73,7 +75,7 @@ jobs:
7375
7476
- name: Configure git
7577
env:
76-
BRANCH: ${{ github.event.inputs.branch }}
78+
BRANCH: ${{ github.ref_name }}
7779
VERSION_BUMP: ${{ github.event.inputs.version_bump }}
7880
run: |
7981
git config --global user.name "aws-crypto-tools-ci-bot"
@@ -105,7 +107,10 @@ jobs:
105107
runs-on: ubuntu-latest
106108
needs: [pre-release-ci, version]
107109
steps:
110+
# Include the version-bump commit the version job pushed
108111
- uses: actions/checkout@v4
112+
with:
113+
ref: ${{ github.ref_name }}
109114

110115
- uses: actions/setup-node@v4
111116
with:

0 commit comments

Comments
 (0)