Skip to content

Commit 7c40db2

Browse files
chore: update github actions (#528)
* chore: update github actions * chore: revert npm tag to next
1 parent 32cc343 commit 7c40db2

File tree

4 files changed

+39
-67
lines changed

4 files changed

+39
-67
lines changed

.github/workflows/release-rc.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,19 @@ jobs:
1515
uses: actions/checkout@v3
1616
with:
1717
fetch-depth: 0
18-
ref: develop
18+
ref: ${{ github.ref }}
19+
20+
- name: Validate Branch 🚨
21+
run: |
22+
# Get the branch name from the tag
23+
BRANCH_NAME=$(git branch -r --contains ${{ github.ref_name }} | grep -E 'origin/(main|release/.*)' | head -1 | sed 's/origin\///')
24+
25+
if [ -z "$BRANCH_NAME" ]; then
26+
echo "❌ Error: Tag ${{ github.ref_name }} was not created from main or a release/* branch"
27+
exit 1
28+
fi
29+
30+
echo "✅ Tag ${{ github.ref_name }} is valid - created from branch: $BRANCH_NAME"
1931
2032
- name: Setup pnpm 9
2133
uses: pnpm/action-setup@v4
@@ -55,3 +67,13 @@ jobs:
5567
env:
5668
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5769
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
70+
- name: Generate GitHub Pre-Release Notes 📓
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
run: |
74+
gh release create "$GITHUB_REF_NAME" \
75+
--repo "$GITHUB_REPOSITORY" \
76+
--generate-notes \
77+
--prerelease \
78+
--verify-tag
79+

.github/workflows/release.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,19 @@ jobs:
1515
uses: actions/checkout@v3
1616
with:
1717
fetch-depth: 0
18-
ref: main
18+
ref: ${{ github.ref }}
19+
20+
- name: Validate Branch 🚨
21+
run: |
22+
# Get the branch name from the tag
23+
BRANCH_NAME=$(git branch -r --contains ${{ github.ref_name }} | grep -E 'origin/(main|release/.*)' | head -1 | sed 's/origin\///')
24+
25+
if [ -z "$BRANCH_NAME" ]; then
26+
echo "❌ Error: Tag ${{ github.ref_name }} was not created from main or a release/* branch"
27+
exit 1
28+
fi
29+
30+
echo "✅ Tag ${{ github.ref_name }} is valid - created from branch: $BRANCH_NAME"
1931
2032
- name: Setup pnpm 9
2133
uses: pnpm/action-setup@v4
@@ -63,4 +75,4 @@ jobs:
6375
gh release create "$GITHUB_REF_NAME" \
6476
--repo "$GITHUB_REPOSITORY" \
6577
--generate-notes \
66-
--verify-tag
78+
--verify-tag

.github/workflows/sync-develop.yaml

Lines changed: 0 additions & 62 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Tests
22

33
on:
44
pull_request:
5-
branches: [main, develop]
5+
branches: [main]
66
push:
7-
branches: [main, develop]
7+
branches: [main]
88

99
jobs:
1010
test-and-lint:

0 commit comments

Comments
 (0)