Release: clarify lightweight tag rejection
This commit is contained in:
1 parent
523355a128
commit
30e669359a
3 files changed
+21
-3
No files matched your search
@@ -87,6 +87,7 @@ if (
|
||||
fi
|
||||
|
||||
git -C "$repository" tag lightweight "$target_commit"
|
||||
lightweight_error="$temporary/lightweight-error.txt"
|
||||
if (
|
||||
cd "$repository"
|
||||
"$verifier" \
|
||||
@@ -94,10 +95,13 @@ if (
|
||||
--event-sha "$target_commit" \
|
||||
--allowed-signers "$temporary/allowed-signers" \
|
||||
--notes-output "$temporary/lightweight-notes.md" \
|
||||
>/dev/null 2>&1
|
||||
>/dev/null 2>"$lightweight_error"
|
||||
); then
|
||||
printf '%s\n' 'lightweight tag was accepted' >&2
|
||||
exit 1
|
||||
fi
|
||||
grep -Fqx \
|
||||
'verify-gitea-release-tag: lightweight tags are not allowed; create a signed annotated tag' \
|
||||
"$lightweight_error"
|
||||
|
||||
printf '%s\n' 'Gitea signed-tag verification tests passed'
|
||||
@@ -66,7 +66,17 @@ if [[ ! -f "$allowed_signers" || -L "$allowed_signers" ||
|
||||
fi
|
||||
|
||||
tag_ref="refs/tags/$tag"
|
||||
tag_object=$(git rev-parse --verify "$tag_ref^{tag}")
|
||||
if ! tag_object=$(git rev-parse --verify "$tag_ref"); then
|
||||
printf '%s\n' \
|
||||
'verify-gitea-release-tag: tag ref does not exist' >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ "$(git cat-file -t "$tag_object")" != tag ]]; then
|
||||
printf '%s\n' \
|
||||
'verify-gitea-release-tag: lightweight tags are not allowed; create a signed annotated tag' \
|
||||
>&2
|
||||
exit 1
|
||||
fi
|
||||
tag_target=$(
|
||||
git cat-file tag "$tag_object" |
|
||||
sed -n '1s/^object //p'
|
||||
|
||||
Reference in new issue
Block a user