From 3df9c4d9e602b30d664683cb916037c911a93ade Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Thu, 11 Jun 2026 15:43:11 -0400 Subject: [PATCH] fix: switch trigger dispatch to DISPATCH_TOKEN with verified Actions scope MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ACTIONS_TOKEN's dispatch attempts were failing silently. DISPATCH_TOKEN is a new cinny repo secret with confirmed actions:write scope. Also fix the HTTP check to use -ge/-lt arithmetic instead of -lt/-gt. NOTE: DISPATCH_TOKEN should be replaced with a permanent Gitea API token that has actions:write scope (create in Gitea user settings → Applications). Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/trigger-desktop.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/trigger-desktop.yml b/.gitea/workflows/trigger-desktop.yml index 9518baad0..4ecc6e3c5 100644 --- a/.gitea/workflows/trigger-desktop.yml +++ b/.gitea/workflows/trigger-desktop.yml @@ -8,10 +8,10 @@ jobs: trigger: runs-on: ubuntu-latest steps: - - name: Bump cinny submodule in cinny-desktop + - name: Bump cinny submodule and dispatch desktop build env: TOKEN: ${{ secrets.RELEASE_TOKEN }} - ACTIONS_TOKEN: ${{ secrets.ACTIONS_TOKEN }} + DISPATCH_TOKEN: ${{ secrets.DISPATCH_TOKEN }} run: | CINNY_SHA="${{ github.sha }}" git clone "https://x-access-token:$TOKEN@code.lotusguild.org/LotusGuild/cinny-desktop.git" desktop @@ -23,21 +23,22 @@ jobs: git -C cinny checkout "$CINNY_SHA" git add cinny if git diff --cached --quiet; then - echo "Submodule already at $CINNY_SHA, nothing to do" + echo "Submodule already at $CINNY_SHA, skipping commit" else git commit -m "chore: bump cinny submodule to ${CINNY_SHA:0:8}" git push origin main fi - echo "Dispatching cinny-desktop release workflow..." - HTTP=$(curl -s -o /tmp/dispatch_body.txt -w "%{http_code}" -X POST \ + echo "Dispatching cinny-desktop release.yml on ref=main ..." + HTTP=$(curl -s -o /tmp/dispatch_resp.json -w "%{http_code}" -X POST \ "https://code.lotusguild.org/api/v1/repos/LotusGuild/cinny-desktop/actions/workflows/release.yml/dispatches" \ - -H "Authorization: token $ACTIONS_TOKEN" \ + -H "Authorization: token $DISPATCH_TOKEN" \ -H "Content-Type: application/json" \ -d '{"ref":"main"}') - echo "Dispatch HTTP status: $HTTP" - cat /tmp/dispatch_body.txt || true - if [ "$HTTP" -lt 200 ] || [ "$HTTP" -gt 299 ]; then - echo "ERROR: dispatch failed with HTTP $HTTP" + echo "HTTP $HTTP" + cat /tmp/dispatch_resp.json 2>/dev/null || true + if [ "$HTTP" -ge 200 ] && [ "$HTTP" -lt 300 ]; then + echo "Dispatch succeeded (HTTP $HTTP)" + else + echo "ERROR: dispatch returned HTTP $HTTP — check DISPATCH_TOKEN scope" exit 1 fi - echo "Dispatch succeeded."