fix: use ACTIONS_TOKEN for workflow dispatch, log HTTP status
RELEASE_TOKEN may lack Actions write scope. ACTIONS_TOKEN already exists as a repo secret and is the correct token for dispatching workflows. Also capture and print the HTTP response so failures are visible in logs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ jobs:
|
|||||||
- name: Bump cinny submodule in cinny-desktop
|
- name: Bump cinny submodule in cinny-desktop
|
||||||
env:
|
env:
|
||||||
TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
ACTIONS_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
CINNY_SHA="${{ github.sha }}"
|
CINNY_SHA="${{ github.sha }}"
|
||||||
git clone "https://x-access-token:$TOKEN@code.lotusguild.org/LotusGuild/cinny-desktop.git" desktop
|
git clone "https://x-access-token:$TOKEN@code.lotusguild.org/LotusGuild/cinny-desktop.git" desktop
|
||||||
@@ -27,10 +28,16 @@ jobs:
|
|||||||
git commit -m "chore: bump cinny submodule to ${CINNY_SHA:0:8}"
|
git commit -m "chore: bump cinny submodule to ${CINNY_SHA:0:8}"
|
||||||
git push origin main
|
git push origin main
|
||||||
fi
|
fi
|
||||||
# Explicitly dispatch the desktop build — the push trigger alone
|
echo "Dispatching cinny-desktop release workflow..."
|
||||||
# does not fire reliably in this Gitea/act runner setup.
|
HTTP=$(curl -s -o /tmp/dispatch_body.txt -w "%{http_code}" -X POST \
|
||||||
curl -sf -X POST \
|
|
||||||
"https://code.lotusguild.org/api/v1/repos/LotusGuild/cinny-desktop/actions/workflows/release.yml/dispatches" \
|
"https://code.lotusguild.org/api/v1/repos/LotusGuild/cinny-desktop/actions/workflows/release.yml/dispatches" \
|
||||||
-H "Authorization: token $TOKEN" \
|
-H "Authorization: token $ACTIONS_TOKEN" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"ref":"main"}'
|
-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"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Dispatch succeeded."
|
||||||
|
|||||||
Reference in New Issue
Block a user