mirror of
https://github.com/penpot/penpot.git
synced 2026-10-29 05:50:35 +00:00
👷 Use only the closest tag in the build key
The full `git describe` output is not stable across checkouts: the length of its -g<sha> suffix depends on the local object count, so build-bundle and build-docker could compute different keys for the same commit on different runner workspaces. The sha already pins the commit, so the closest tag is enough to tell versions apart. Signed-off-by: David Barragán Merino <david.barragan@kaleidos.net>
This commit is contained in:
parent
cf19d7f870
commit
4b13562d02
10
.github/workflows/build-bundle.yml
vendored
10
.github/workflows/build-bundle.yml
vendored
@ -80,13 +80,17 @@ jobs:
|
||||
env:
|
||||
GH_REF: ${{ inputs.gh_ref || github.ref_name }}
|
||||
run: |
|
||||
# Same command the build uses to stamp version.txt, so the key
|
||||
# always matches what ends up inside the bundle.
|
||||
# Same command the build uses to stamp version.txt.
|
||||
BUNDLE_VERSION=$(./manage.sh version)
|
||||
SHORT_SHA=$(git rev-parse --short=12 HEAD)
|
||||
# The key takes only the closest tag (--abbrev=0): the sha already
|
||||
# pins the commit, and the full describe output is not stable
|
||||
# across checkouts (its -g<sha> suffix length depends on the
|
||||
# local object count). Must match build-docker.yml.
|
||||
VERSION_TAG=$(git describe --tags --match '*.*.*' --abbrev=0)
|
||||
echo "gh_ref=$GH_REF" >> $GITHUB_OUTPUT
|
||||
echo "bundle_version=$BUNDLE_VERSION" >> $GITHUB_OUTPUT
|
||||
echo "build_key=sha-${SHORT_SHA}-${BUNDLE_VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "build_key=sha-${SHORT_SHA}-${VERSION_TAG}" >> $GITHUB_OUTPUT
|
||||
echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT
|
||||
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
|
||||
echo "commit_title=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT
|
||||
|
||||
3
.github/workflows/build-docker.yml
vendored
3
.github/workflows/build-docker.yml
vendored
@ -109,11 +109,12 @@ jobs:
|
||||
# Must match the key computed by build-bundle.yml.
|
||||
BUNDLE_VERSION=$(./manage.sh version)
|
||||
SHORT_SHA=$(git rev-parse --short=12 HEAD)
|
||||
VERSION_TAG=$(git describe --tags --match '*.*.*' --abbrev=0)
|
||||
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
|
||||
echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT
|
||||
echo "commit_title=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT
|
||||
echo "bundle_version=$BUNDLE_VERSION" >> $GITHUB_OUTPUT
|
||||
echo "build_key=sha-${SHORT_SHA}-${BUNDLE_VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "build_key=sha-${SHORT_SHA}-${VERSION_TAG}" >> $GITHUB_OUTPUT
|
||||
|
||||
# The image set is a single block, so a single set-level check is
|
||||
# enough: `promote` drops a marker object in S3 only after every
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user