From 5e9ac59c596f56dc9015aad566ae53f057c1cb74 Mon Sep 17 00:00:00 2001 From: TommyFang Date: Mon, 17 Aug 2026 01:02:21 +0800 Subject: [PATCH] fix: gate on latest.json version; pin script fetch to GITHUB_SHA --- .gitea/workflows/publish.yml | 2 +- scripts/publish-gitea-actions.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index 352254b..05c0738 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Download publish scripts run: | - BASE=https://raw.githubusercontent.com/TommyFang2077/dsh-easy-desktop/main + BASE=https://raw.githubusercontent.com/TommyFang2077/dsh-easy-desktop/$GITHUB_SHA curl -fsSL -o build-gitea-update.py "$BASE/scripts/build-gitea-update.py" curl -fsSL -o publish-gitea-release.sh "$BASE/scripts/publish-gitea-release.sh" curl -fsSL -o publish-gitea-actions.sh "$BASE/scripts/publish-gitea-actions.sh" diff --git a/scripts/publish-gitea-actions.sh b/scripts/publish-gitea-actions.sh index 72c86da..e751382 100755 --- a/scripts/publish-gitea-actions.sh +++ b/scripts/publish-gitea-actions.sh @@ -24,8 +24,9 @@ echo "target: $RELEASE_TAG ($VERSION)" echo "gitea: $GITEA_BASE_URL" if curl -fsS -H "Authorization: token $GITEA_TOKEN" \ - "$GITEA_BASE_URL/api/packages/$REPO_OWNER/generic/dsh-easy-desktop-updater/$VERSION/dsh-easy-desktop_${VERSION}_darwin_aarch64.app.tar.gz" >/dev/null 2>&1; then - echo "version $VERSION already published on the Gitea package feed; nothing to do" + "$GITEA_BASE_URL/api/packages/$REPO_OWNER/generic/dsh-easy-desktop-updater/latest/latest.json" -o /tmp/latest.json 2>/dev/null \ + && [ "$(jq -r '.version' /tmp/latest.json)" = "$VERSION" ]; then + echo "version $VERSION already published on the Gitea feed; nothing to do" exit 0 fi