Skip to content

Commit 38df152

Browse files
jfrochesamrose
authored andcommitted
fix: generate a unique AMI version
GitHub run_id is appended to the version suffix to ensure uniqueness. It also enables to track the AMI back to the specific workflow run that created it using url like: https://github.com/supabase/postgres/actions/runs/<run_id>
1 parent dfc525c commit 38df152

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/ami-release-nix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
PG_VERSION="$(nix run nixpkgs#yq -- -r '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)"
7878
BRANCH_NAME="$(echo "${{ github.ref }}" | sed 's|refs/heads/||')"
7979
if [[ "${{ github.event_name }}" == "workflow_dispatch" && "$BRANCH_NAME" != "develop" && "$BRANCH_NAME" != release/* ]]; then
80-
SUFFIX="${BRANCH_NAME//[^a-zA-Z0-9._-]/-}"
80+
SUFFIX="${BRANCH_NAME//[^a-zA-Z0-9._-]/-}-${{ github.run_id }}"
8181
PG_VERSION="${PG_VERSION}-${SUFFIX}"
8282
echo "Added branch suffix to version: $SUFFIX"
8383
fi

0 commit comments

Comments
 (0)