mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 15:25:46 +00:00
fix(release): retarget mismatched tags instead of failing (#389)
When an existing app-v tag points to a different commit than source_ref, re-point it to the checked out source commit and continue publishing. This preserves Source code archive correctness without blocking artifact release.
This commit is contained in:
@@ -89,7 +89,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
echo "value=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
|
echo "value=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
|
||||||
- name: validate existing tag points to source ref
|
- name: align existing tag to source ref
|
||||||
env:
|
env:
|
||||||
TAG: ${{ steps.tag.outputs.value }}
|
TAG: ${{ steps.tag.outputs.value }}
|
||||||
EXPECTED_SHA: ${{ steps.source-sha.outputs.value }}
|
EXPECTED_SHA: ${{ steps.source-sha.outputs.value }}
|
||||||
@@ -99,9 +99,10 @@ jobs:
|
|||||||
if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; then
|
if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; then
|
||||||
TAG_SHA="$(git rev-list -n 1 "refs/tags/$TAG")"
|
TAG_SHA="$(git rev-list -n 1 "refs/tags/$TAG")"
|
||||||
if [ "$TAG_SHA" != "$EXPECTED_SHA" ]; then
|
if [ "$TAG_SHA" != "$EXPECTED_SHA" ]; then
|
||||||
echo "::error::Tag '$TAG' points to $TAG_SHA, expected $EXPECTED_SHA from source_ref '${{ inputs.source_ref }}'"
|
echo "::warning::Tag '$TAG' points to $TAG_SHA, expected $EXPECTED_SHA from source_ref '${{ inputs.source_ref }}'"
|
||||||
echo "::error::Refusing to publish mixed release (binary artifacts from source_ref but Source code archive from another commit)."
|
echo "::warning::Re-pointing tag '$TAG' to expected source commit to keep Source code archives aligned with built artifacts."
|
||||||
exit 1
|
git tag -f "$TAG" "$EXPECTED_SHA"
|
||||||
|
git push --force origin "refs/tags/$TAG"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
- name: extract changelog
|
- name: extract changelog
|
||||||
|
|||||||
Reference in New Issue
Block a user