diff --git a/sr/action.yaml b/sr/action.yaml index af4054f..f1c1fa6 100644 --- a/sr/action.yaml +++ b/sr/action.yaml @@ -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