mirror of
https://code.forgejo.org/actions/forgejo-release.git
synced 2025-04-24 18:02:15 +00:00
override tag is SHAs don't match
This commit is contained in:
parent
c8da55adba
commit
ec4a3e9cf2
1 changed files with 8 additions and 3 deletions
|
@ -32,9 +32,14 @@ ensure_tag() {
|
||||||
if api GET repos/$REPO/tags/$TAG > $TMP_DIR/tag.json ; then
|
if api GET repos/$REPO/tags/$TAG > $TMP_DIR/tag.json ; then
|
||||||
local sha=$(jq --raw-output .commit.sha < $TMP_DIR/tag.json)
|
local sha=$(jq --raw-output .commit.sha < $TMP_DIR/tag.json)
|
||||||
if test "$sha" != "$SHA" ; then
|
if test "$sha" != "$SHA" ; then
|
||||||
cat $TMP_DIR/tag.json
|
if test "$OVERRIDE" = "true"; then
|
||||||
echo "the tag SHA in the $REPO repository does not match the tag SHA that triggered the build: $SHA"
|
echo "Removing existing tag, ${TAG}"
|
||||||
false
|
api DELETE repos/$REPO/tags/$TAG >& /dev/null || true
|
||||||
|
else
|
||||||
|
cat $TMP_DIR/tag.json
|
||||||
|
echo "the tag SHA in the $REPO repository does not match the tag SHA that triggered the build: $SHA"
|
||||||
|
false
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
api POST repos/$REPO/tags --data-raw '{"tag_name": "'$TAG'", "target": "'$SHA'"}'
|
api POST repos/$REPO/tags --data-raw '{"tag_name": "'$TAG'", "target": "'$SHA'"}'
|
||||||
|
|
Loading…
Add table
Reference in a new issue