Skip to content

Commit a1648b9

Browse files
committed
ci: change semantic-release for org
1 parent 773d299 commit a1648b9

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/semantic-release.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,37 @@ on:
88
jobs:
99
build:
1010
name: Semantic release
11-
environment: main
1211
runs-on: ubuntu-latest
1312
steps:
1413
- uses: actions/checkout@v4
1514
with:
1615
persist-credentials: false
1716

17+
- uses: actions/create-github-app-token@v2
18+
id: app-token
19+
with:
20+
app-id: "${{ secrets.SEMANTIC_RELEASE_APP_ID }}"
21+
private-key: "${{ secrets.SEMANTIC_RELEASE_PRIVATE_KEY }}"
22+
1823
- name: Semantic release
1924
id: semantic
2025
uses: cycjimmy/semantic-release-action@v4
2126
env:
22-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
23-
HACKAGE_KEY: ${{ secrets.HACKAGE_TOKEN }}
27+
GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}"
28+
HACKAGE_KEY: "${{ secrets.HACKAGE_TOKEN }}"
2429

2530
with:
26-
ci: ${{ github.ref == 'refs/heads/main' }}
31+
ci: ${{ github.ref == github.event.repository.default_branch }}
2732
extra_plugins: |
2833
conventional-changelog-conventionalcommits
2934
semantic-release-mirror-version
3035
semantic-release-stack-upload
3136
3237
- name: Semantic release output
3338
run: |
34-
echo ref: ${{ github.ref }}
35-
echo dry_run: ${{ github.ref != 'refs/heads/main' }}
39+
echo default_branch: ${{ github.event.repository.default_branch }}
40+
echo ref: ${{ github.ref_name }}
41+
echo dry_run: ${{ github.ref_name != github.event.repository.default_branch }}
3642
echo published: ${{ steps.semantic.outputs.new_release_published }}
3743
echo last_release: ${{ steps.semantic.outputs.last_release_version }}
3844
echo new_version: ${{ steps.semantic.outputs.new_release_version }}

0 commit comments

Comments
 (0)