File tree Expand file tree Collapse file tree 4 files changed +39
-67
lines changed
Expand file tree Collapse file tree 4 files changed +39
-67
lines changed Original file line number Diff line number Diff line change 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
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+
Original file line number Diff line number Diff line change 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
6375 gh release create "$GITHUB_REF_NAME" \
6476 --repo "$GITHUB_REPOSITORY" \
6577 --generate-notes \
66- --verify-tag
78+ --verify-tag
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ name: Tests
22
33on :
44 pull_request :
5- branches : [main, develop ]
5+ branches : [main]
66 push :
7- branches : [main, develop ]
7+ branches : [main]
88
99jobs :
1010 test-and-lint :
You can’t perform that action at this time.
0 commit comments