diff --git a/.github/workflows/ami-release-nix-single.yml b/.github/workflows/ami-release-nix-single.yml index f2c2abf9e..86a1d40fc 100644 --- a/.github/workflows/ami-release-nix-single.yml +++ b/.github/workflows/ami-release-nix-single.yml @@ -28,6 +28,11 @@ jobs: with: ref: ${{ github.event.inputs.branch }} + - name: Get current branch SHA + id: get_sha + run: | + echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + - uses: DeterminateSystems/nix-installer-action@main - name: Set PostgreSQL version environment variable @@ -46,7 +51,7 @@ jobs: POSTGRES_MAJOR_VERSION: ${{ env.POSTGRES_MAJOR_VERSION }} run: | packer init amazon-arm64-nix.pkr.hcl - GIT_SHA=${{github.sha}} + GIT_SHA=${{ steps.get_sha.outputs.sha }} packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl - name: Build AMI stage 2 @@ -54,7 +59,7 @@ jobs: POSTGRES_MAJOR_VERSION: ${{ env.POSTGRES_MAJOR_VERSION }} run: | packer init stage2-nix-psql.pkr.hcl - GIT_SHA=${{github.sha}} + GIT_SHA=${{ steps.get_sha.outputs.sha }} POSTGRES_MAJOR_VERSION=${{ env.POSTGRES_MAJOR_VERSION }} packer build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl @@ -66,7 +71,7 @@ jobs: - name: Create nix flake revision tarball run: | - GIT_SHA=${{github.sha}} + GIT_SHA=${{ steps.get_sha.outputs.sha }} MAJOR_VERSION=${{ env.POSTGRES_MAJOR_VERSION }} mkdir -p "/tmp/pg_upgrade_bin/${MAJOR_VERSION}" @@ -116,7 +121,7 @@ jobs: with: name: ${{ steps.process_release_version.outputs.version }} tag_name: ${{ steps.process_release_version.outputs.version }} - target_commitish: ${{github.sha}} + target_commitish: ${{ steps.get_sha.outputs.sha }} - name: Slack Notification on Failure if: ${{ failure() }}