fix: Use nix-shell for sed

This commit is contained in:
2026-06-16 12:32:23 +02:00
parent 308647bc5d
commit 08f1ca4694
+8 -8
View File
@@ -117,15 +117,15 @@ runs:
shell: bash
env:
GITEA_TOKEN: ${{ inputs.gitea-token }}
GITEA_URL: ${{ inputs.gitea-url }}
run: |
set -o pipefail
set -o nounset
set -o errexit
# Push as the real user behind GITEA_TOKEN, not the checkout's Actions token (uid -2).
repo_path="$(git remote get-url origin | sed -E 's#^https?://[^/]+/##')"
host="$(echo "$GITEA_URL" | sed -E 's#^https?://##; s#/$##')"
git remote set-url origin "https://oauth2:${GITEA_TOKEN}@${host}/${repo_path}"
nix-shell -p git gnused coreutils --run '
set -o pipefail
set -o nounset
set -o errexit
# Push as the real user behind GITEA_TOKEN, not the checkout token (uid -2).
host_path="$(git remote get-url origin | sed -E "s#^https?://([^@]*@)?##")"
git remote set-url origin "https://oauth2:${GITEA_TOKEN}@${host_path}"
'
- name: Run semantic-release
id: semantic