Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a346f8db9a |
18
.github/workflows/semantic-release.yml
vendored
18
.github/workflows/semantic-release.yml
vendored
@@ -5,7 +5,7 @@ on:
|
|||||||
secrets:
|
secrets:
|
||||||
GH_TOKEN:
|
GH_TOKEN:
|
||||||
description: 'PAT with repo access, required to trigger workflows on tag push'
|
description: 'PAT with repo access, required to trigger workflows on tag push'
|
||||||
required: true
|
required: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
@@ -17,14 +17,26 @@ jobs:
|
|||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: ${{ secrets.GH_TOKEN }}
|
token: ${{ secrets.GH_TOKEN || github.token }}
|
||||||
|
|
||||||
- name: Setup semantic-release
|
- name: Setup semantic-release
|
||||||
uses: https://gitea.ldpt.fr/actions/semantic-release/setup-semrel@main
|
uses: https://gitea.ldpt.fr/actions/semantic-release/setup-semrel@main
|
||||||
with:
|
with:
|
||||||
node-version: "24"
|
node-version: "24"
|
||||||
|
|
||||||
- name: Run semantic-release
|
- name: Configure git remote with PAT
|
||||||
|
if: ${{ secrets.GH_TOKEN != '' }}
|
||||||
|
shell: bash
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
REMOTE_URL=$(git remote get-url origin)
|
||||||
|
# Inject PAT so tag pushes come from the PAT user, not the Actions runner token
|
||||||
|
NEW_URL=$(echo "$REMOTE_URL" | sed "s|https://|https://oauth2:${GH_TOKEN}@|")
|
||||||
|
git remote set-url origin "$NEW_URL"
|
||||||
|
|
||||||
|
- name: Run semantic-release
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
|
||||||
run: semantic-release
|
run: semantic-release
|
||||||
Reference in New Issue
Block a user