diff --git a/.github/workflows/prod-release.yml b/.github/workflows/prod-release.yml index 131370f3c..eec61380f 100644 --- a/.github/workflows/prod-release.yml +++ b/.github/workflows/prod-release.yml @@ -14,10 +14,6 @@ on: description: 'NPM distribution tag' required: false default: 'latest' - branch: - description: 'The branch to release from' - required: false - default: 'master' env: NODE_OPTIONS: "--max-old-space-size=4096" @@ -32,6 +28,12 @@ jobs: runs-on: ubuntu-latest needs: [pre-release-ci] steps: + - name: Require a branch + if: github.ref_type != 'branch' + run: | + 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." + exit 1 + - name: Checkout code uses: actions/checkout@v4 with: @@ -73,7 +75,7 @@ jobs: - name: Configure git env: - BRANCH: ${{ github.event.inputs.branch }} + BRANCH: ${{ github.ref_name }} VERSION_BUMP: ${{ github.event.inputs.version_bump }} run: | git config --global user.name "aws-crypto-tools-ci-bot" @@ -105,7 +107,10 @@ jobs: runs-on: ubuntu-latest needs: [pre-release-ci, version] steps: + # Include the version-bump commit the version job pushed - uses: actions/checkout@v4 + with: + ref: ${{ github.ref_name }} - uses: actions/setup-node@v4 with: