wewrite/.github/workflows/build-openclaw.yml
wangzhuc ae37aa49e1 fix(ci): use full clone to prevent history loss on amend + force push
actions/checkout@v4 defaults to depth=1. When the CI amends the
triggering commit and force-pushes, the shallow history replaces
the full history on the remote — wiping all prior commits.

Fix: set fetch-depth: 0 for full clone.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 00:00:40 +08:00

44 lines
1,001 B
YAML

name: Build OpenClaw Skill
on:
workflow_dispatch:
push:
branches: [main]
paths:
- 'SKILL.md'
- 'references/**'
- 'scripts/**'
- 'toolkit/**'
- 'personas/**'
- 'requirements.txt'
- '*.example.yaml'
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build OpenClaw skill
run: python3 scripts/build_openclaw.py
- name: Commit dist/openclaw if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add dist/openclaw/
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit --amend --no-edit
git push --force-with-lease
fi