Skip to content

chore: get and use commit of branch we are trying to build #1614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/ami-release-nix-single.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -46,15 +51,15 @@ 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
env:
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

Expand All @@ -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}"
Expand Down Expand Up @@ -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() }}
Expand Down
Loading