mirror of
https://github.com/HuangYuChuh/ComfyUI_Skills_OpenClaw.git
synced 2026-08-14 08:52:22 +00:00
fix(ci): restore PR+auto-merge for sync-frontend workflow (#28)
Branch protection requires CI checks before merge, so auto-merge now works correctly — it waits for the Backend check to pass then merges. Co-authored-by: Kelin <kelin@KelindeMacBook-Air.local> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Kelin
Claude Sonnet 4.6
parent
6de89ada91
commit
ff89970df5
@@ -5,6 +5,7 @@ on:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
@@ -30,14 +31,21 @@ jobs:
|
||||
mkdir -p ui/static
|
||||
tar -xzf frontend-dist.tar.gz -C ui/static
|
||||
|
||||
- name: Commit and push to main
|
||||
- name: Check for changes
|
||||
id: diff
|
||||
run: |
|
||||
git add ui/static/
|
||||
if git diff --cached --quiet; then
|
||||
echo "Frontend is already up to date. Nothing to sync."
|
||||
exit 0
|
||||
echo "changed=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "changed=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Commit, open PR and enable auto-merge
|
||||
if: steps.diff.outputs.changed == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
@@ -45,7 +53,18 @@ jobs:
|
||||
--repo HuangYuChuh/ComfyUI_Skills_OpenClaw-frontend \
|
||||
--json tagName -q '.tagName' || echo "latest")
|
||||
|
||||
BRANCH="build/frontend-${FRONTEND_SHA}"
|
||||
git checkout -b "$BRANCH"
|
||||
git commit -m "build(ui): sync frontend assets from upstream@${FRONTEND_SHA}"
|
||||
git push origin main
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
git push origin "$BRANCH"
|
||||
|
||||
PR_URL=$(gh pr create \
|
||||
--title "build(ui): sync frontend assets from upstream@${FRONTEND_SHA}" \
|
||||
--body "Auto-generated by \`sync-frontend\` workflow." \
|
||||
--base main)
|
||||
|
||||
gh pr merge "$PR_URL" --auto --squash
|
||||
|
||||
- name: No changes
|
||||
if: steps.diff.outputs.changed == 'false'
|
||||
run: echo "Frontend is already up to date. Nothing to sync."
|
||||
|
||||
Reference in New Issue
Block a user