fix(ci): add authentication for tag push in release workflow
- Use RELEASE_TOKEN for git push authentication when creating tags - Add early check to fail with clear error if RELEASE_TOKEN is not configured
This commit is contained in:
parent
725ebcfbfd
commit
8d5bdaa518
1 changed files with 13 additions and 1 deletions
|
|
@ -12,6 +12,15 @@ jobs:
|
||||||
runs-on: nix
|
runs-on: nix
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Check RELEASE_TOKEN is configured
|
||||||
|
env:
|
||||||
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$RELEASE_TOKEN" ]; then
|
||||||
|
echo "::error::RELEASE_TOKEN secret is not configured. Please add it in repository settings."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Check out Repository
|
- name: Check out Repository
|
||||||
uses: https://git.konstantinfickel.de/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
uses: https://git.konstantinfickel.de/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
with:
|
with:
|
||||||
|
|
@ -19,6 +28,8 @@ jobs:
|
||||||
|
|
||||||
- name: Extract version and handle tagging
|
- name: Extract version and handle tagging
|
||||||
id: version
|
id: version
|
||||||
|
env:
|
||||||
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
# Manual trigger: read version from Cargo.toml
|
# Manual trigger: read version from Cargo.toml
|
||||||
|
|
@ -31,8 +42,9 @@ jobs:
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create and push the tag
|
# Create and push the tag using RELEASE_TOKEN for authentication
|
||||||
git tag "$TAG"
|
git tag "$TAG"
|
||||||
|
git remote set-url origin "https://oauth2:${RELEASE_TOKEN}@git.konstantinfickel.de/kfickel/streamd.git"
|
||||||
git push origin "$TAG"
|
git push origin "$TAG"
|
||||||
|
|
||||||
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue