Skip to content

Commit 1520738

Browse files
author
rahul-infra
committed
fix: use semantic-release with proper branch configuration
1 parent 6a44c48 commit 1520738

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

.github/workflows/version-preview.yaml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,35 @@ jobs:
1616
name: Preview Release
1717
runs-on: ubuntu-latest
1818
steps:
19-
- name: Checkout
19+
- name: Checkout PR merge commit
2020
uses: actions/checkout@v4
2121
with:
2222
fetch-depth: 0
23+
ref: refs/pull/${{ github.event.pull_request.number }}/merge
24+
25+
- name: Configure for preview
26+
run: |
27+
# Create temporary releaserc that allows any branch
28+
cat > .releaserc.json << 'EOF'
29+
{
30+
"branches": ["*"],
31+
"plugins": [
32+
"@semantic-release/commit-analyzer",
33+
"@semantic-release/release-notes-generator",
34+
["@semantic-release/changelog", {"changelogFile": "CHANGELOG.md"}],
35+
["@semantic-release/git", {"assets": ["CHANGELOG.md"]}],
36+
"@semantic-release/github"
37+
]
38+
}
39+
EOF
40+
git branch -m temp-preview-branch
2341
2442
- name: Preview Release
2543
id: semantic
2644
uses: cycjimmy/semantic-release-action@v2
2745
with:
2846
semantic_version: 18.0.0
2947
dry_run: true
30-
branches: |
31-
[
32-
'main',
33-
{name: '*', prerelease: true}
34-
]
3548
extra_plugins: |
3649
@semantic-release/changelog@6.0.0
3750
@semantic-release/git@10.0.0

0 commit comments

Comments
 (0)