fix(ci): replace workflow dispatch with submodule bump push
workflow_dispatch API requires Actions:write token scope which RELEASE_TOKEN doesn't have. Worse, even a successful dispatch would check out the old pinned submodule SHA, not the new cinny commit. New approach: clone cinny-desktop, point the cinny submodule at the current commit SHA, commit, and push. The push to cinny-desktop/main fires release.yml naturally — no special permissions needed beyond repo write (which RELEASE_TOKEN already has for release uploads). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,13 +8,30 @@ jobs:
|
|||||||
trigger:
|
trigger:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Trigger cinny-desktop release build
|
- name: Bump cinny submodule in cinny-desktop and push
|
||||||
env:
|
env:
|
||||||
TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
curl -sf -X POST \
|
CINNY_SHA="${{ github.sha }}"
|
||||||
"https://code.lotusguild.org/api/v1/repos/LotusGuild/cinny-desktop/actions/workflows/release.yml/dispatches" \
|
echo "Bumping cinny submodule to $CINNY_SHA"
|
||||||
-H "Authorization: token $TOKEN" \
|
|
||||||
-H "Content-Type: application/json" \
|
git clone "https://x-access-token:$TOKEN@code.lotusguild.org/LotusGuild/cinny-desktop.git" desktop
|
||||||
-d '{"ref":"main"}'
|
cd desktop
|
||||||
echo "Desktop build triggered"
|
|
||||||
|
git config user.email "ci@lotusguild.org"
|
||||||
|
git config user.name "Lotus CI"
|
||||||
|
|
||||||
|
# Fetch the cinny submodule and point it at the new SHA
|
||||||
|
git submodule update --init cinny
|
||||||
|
git -C cinny fetch origin
|
||||||
|
git -C cinny checkout "$CINNY_SHA"
|
||||||
|
|
||||||
|
git add cinny
|
||||||
|
# Only commit + push if the submodule pointer actually changed
|
||||||
|
if git diff --cached --quiet; then
|
||||||
|
echo "Submodule already at $CINNY_SHA — no push needed"
|
||||||
|
else
|
||||||
|
git commit -m "chore: bump cinny submodule to ${CINNY_SHA:0:8}"
|
||||||
|
git push origin main
|
||||||
|
echo "Pushed — cinny-desktop release build triggered"
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user