Skip to content

Commit 12feef4

Browse files
CopilotsweatybridgeCopilot
authored
feat: add workflow to create and push pkg Go module version tags (#5001)
* Initial plan * feat: add workflow to create and push pkg version tags Agent-Logs-Url: https://github.com/supabase/cli/sessions/78b5dd93-1c78-4cdc-b6f0-c664080934b8 Co-authored-by: sweatybridge <1639722+sweatybridge@users.noreply.github.com> * feat: add version validation and tag existence check to tag-pkg workflow Agent-Logs-Url: https://github.com/supabase/cli/sessions/78b5dd93-1c78-4cdc-b6f0-c664080934b8 Co-authored-by: sweatybridge <1639722+sweatybridge@users.noreply.github.com> * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sweatybridge <1639722+sweatybridge@users.noreply.github.com> Co-authored-by: Han Qiao <sweatybridge@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 92d1056 commit 12feef4

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/tag-pkg.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Tag pkg
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "pkg version to tag (e.g. v1.2.2)"
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
tag:
16+
name: Create pkg tag
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
with:
21+
ref: develop
22+
fetch-depth: 0
23+
24+
- name: Create and push pkg tag
25+
run: |
26+
VERSION="${{ inputs.version }}"
27+
if ! [[ "$VERSION" =~ ^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then
28+
echo "Error: version '$VERSION' does not match semver format (e.g. v1.2.2)"
29+
exit 1
30+
fi
31+
TAG="pkg/$VERSION"
32+
if git rev-parse "$TAG" >/dev/null 2>&1; then
33+
echo "Error: tag '$TAG' already exists"
34+
exit 1
35+
fi
36+
git tag "$TAG"
37+
git push origin "$TAG"

0 commit comments

Comments
 (0)