Skip to content

Commit 1e66f61

Browse files
committed
ci: do not use hardcoded default branch
1 parent 2ea09a8 commit 1e66f61

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

.github/workflows/semantic-release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ name: Semantic release
33
on:
44
push:
55
branches:
6-
- main
6+
- "${{ github.event.repository.default_branch }}"
77

88
jobs:
99
build:
1010
name: Semantic release
11-
environment: main
1211
runs-on: ubuntu-latest
1312
steps:
1413
- uses: actions/checkout@v4
@@ -30,7 +29,7 @@ jobs:
3029
HACKAGE_KEY: "${{ secrets.HACKAGE_TOKEN }}"
3130

3231
with:
33-
ci: ${{ github.ref == 'refs/heads/main' }}
32+
ci: ${{ github.ref == github.event.repository.default_branch }}
3433
extra_plugins: |
3534
conventional-changelog-conventionalcommits
3635
semantic-release-mirror-version
@@ -39,7 +38,7 @@ jobs:
3938
- name: Semantic release output
4039
run: |
4140
echo ref: ${{ github.ref }}
42-
echo dry_run: ${{ github.ref != 'refs/heads/main' }}
41+
echo dry_run: ${{ github.ref_name != github.event.repository.default_branch }}
4342
echo published: ${{ steps.semantic.outputs.new_release_published }}
4443
echo last_release: ${{ steps.semantic.outputs.last_release_version }}
4544
echo new_version: ${{ steps.semantic.outputs.new_release_version }}

0 commit comments

Comments
 (0)