mirror of
https://code.forgejo.org/actions/forgejo-release.git
synced 2025-07-02 14:03:43 +00:00
fix: the tag cache must be deleted when the tag is deleted
Otherwise it will linger and potentially create problem when using overrides.
This commit is contained in:
parent
e2af55222e
commit
1a6975277b
2 changed files with 26 additions and 4 deletions
|
@ -59,7 +59,18 @@ ensure_tag() {
|
|||
return 1
|
||||
fi
|
||||
else
|
||||
api POST repos/$REPO/tags --data-raw '{"tag_name": "'"$TAG"'", "target": "'"$SHA"'"}' >"$TAG_FILE"
|
||||
create_tag
|
||||
fi
|
||||
}
|
||||
|
||||
create_tag() {
|
||||
api POST repos/$REPO/tags --data-raw '{"tag_name": "'"$TAG"'", "target": "'"$SHA"'"}' >"$TAG_FILE"
|
||||
}
|
||||
|
||||
delete_tag() {
|
||||
if get_tag; then
|
||||
api DELETE repos/$REPO/tags/$TAG
|
||||
rm -f "$TAG_FILE"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -134,7 +145,7 @@ maybe_override() {
|
|||
fi
|
||||
api DELETE repos/$REPO/releases/tags/"$TAG" >&/dev/null || true
|
||||
if get_tag && ! matched_tag; then
|
||||
api DELETE repos/$REPO/tags/"$TAG"
|
||||
delete_tag
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue