Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 3 additions & 22 deletions scripts/tag-and-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,6 @@ if git rev-parse "$tag" >/dev/null 2>&1; then
exit 0
fi

sha=$(git rev-parse HEAD)
repo="${GITHUB_REPOSITORY}"

echo "Creating signed tag: $tag (pointing to $sha)"

# Create an annotated tag object via the GitHub API.
# Tags created server-side are signed by GitHub and display as "Verified".
tag_sha=$(gh api "repos/${repo}/git/tags" \
--method POST \
-f tag="$tag" \
-f message="CRE CLI $tag" \
-f object="$sha" \
-f type="commit" \
--jq '.sha')

# Create the ref pointing to the tag object
gh api "repos/${repo}/git/refs" \
--method POST \
-f ref="refs/tags/$tag" \
-f sha="$tag_sha"

echo "Tag $tag created and verified."
echo "Creating and pushing tag: $tag"
git tag -a "$tag" -m "CRE CLI $tag"
git push origin "$tag"
Loading