From 9cafd56267b9d693a5720c4b5879ff6cd61b080e Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Fri, 20 Feb 2026 13:40:57 -0500 Subject: [PATCH] Make Gitea NuGet workflow POSIX-shell compatible for runner execution. --- .gitea/workflows/nuget-publish.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/nuget-publish.yml b/.gitea/workflows/nuget-publish.yml index f3b0310..4e1b64a 100644 --- a/.gitea/workflows/nuget-publish.yml +++ b/.gitea/workflows/nuget-publish.yml @@ -13,10 +13,11 @@ jobs: steps: - name: Checkout Repository run: | - set -euo pipefail + set -eu REPO_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" if [ -n "${GITHUB_TOKEN:-}" ]; then - REPO_URL="${GITHUB_SERVER_URL/https:\/\//https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@}/${GITHUB_REPOSITORY}.git" + HOST="${GITHUB_SERVER_URL#https://}" + REPO_URL="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@${HOST}/${GITHUB_REPOSITORY}.git" fi git init . @@ -51,10 +52,11 @@ jobs: steps: - name: Checkout Repository run: | - set -euo pipefail + set -eu REPO_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" if [ -n "${GITHUB_TOKEN:-}" ]; then - REPO_URL="${GITHUB_SERVER_URL/https:\/\//https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@}/${GITHUB_REPOSITORY}.git" + HOST="${GITHUB_SERVER_URL#https://}" + REPO_URL="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@${HOST}/${GITHUB_REPOSITORY}.git" fi git init . @@ -79,7 +81,7 @@ jobs: - name: Configure Gitea NuGet Source run: | - set -euo pipefail + set -eu USERNAME="${GITEA_NUGET_USERNAME:-${GITHUB_ACTOR}}" TOKEN="${GITEA_NUGET_TOKEN:-${GITHUB_TOKEN:-}}" @@ -98,9 +100,11 @@ jobs: - name: Publish Packages run: | - set -euo pipefail + set -eu for pkg in nupkgs/*.nupkg; do - if [ -f "$pkg" ] && [[ "$pkg" != *.snupkg ]]; then - dotnet nuget push "$pkg" --source gitea --skip-duplicate - fi + [ -f "$pkg" ] || continue + case "$pkg" in + *.snupkg) continue ;; + esac + dotnet nuget push "$pkg" --source gitea --skip-duplicate done