Skip to content

Commit a14a746

Browse files
authored
Merge pull request #19872 from mozilla/fix-create-version-sha
fix(deploy): Incorrect hash used across multiple tags
2 parents 353600a + 5190f47 commit a14a746

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

.github/workflows/docker.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ jobs:
7878
with:
7979
ref: ${{ env.GIT_TAG }}
8080

81+
- name: Verify tag checkout and commit
82+
shell: bash
83+
run: |
84+
set -euo pipefail
85+
echo "GIT_TAG=${GIT_TAG}"
86+
echo "GITHUB_SHA=${GITHUB_SHA}"
87+
echo "Checked out HEAD=$(git rev-parse HEAD)"
88+
git describe --tags --exact-match | grep -Fx "$GIT_TAG"
89+
git show -s --format='%H %D' HEAD
90+
8191
- uses: actions/setup-node@v6
8292
with:
8393
cache: yarn
@@ -88,6 +98,16 @@ jobs:
8898

8999
- run: ./_scripts/create-version-json.sh
90100

101+
- name: Show generated version.json (sanity check)
102+
shell: bash
103+
run: |
104+
set -euo pipefail
105+
echo "packages/version.json:"
106+
cat ./packages/version.json
107+
echo
108+
echo "apps/version.json:"
109+
cat ./apps/version.json
110+
91111
- uses: docker/setup-buildx-action@v3
92112

93113
- id: meta

_scripts/create-version-json.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if [[ "${CIRCLECI}" == "true" ]]; then
1212
| tee "$DIR/../packages/version.json" "$DIR/../apps/version.json"
1313
elif [[ "${GITHUB_ACTIONS}" == "true" ]]; then
1414
printf '{"version":{"hash":"%s","version":"%s","source":"https://github.com/%s","build":"%s/%s/actions/runs/%s"}}\n' \
15-
"${GITHUB_SHA}" \
15+
"$(git rev-parse HEAD)" \
1616
"${GIT_TAG}" \
1717
"${GITHUB_REPOSITORY}" \
1818
"${GITHUB_SERVER_URL}" \

0 commit comments

Comments
 (0)