ci: add workflow to publish OpenClaw skills to ClawHub (#55)
* ci: add workflow to publish OpenClaw skills to ClawHub * ci: use documented clawhub sync flags * ci: harden publish-skills workflow - Pin clawhub@0.7.0 for supply-chain safety - Add concurrency group to prevent parallel publishes - Add PR dry-run validation - Guard against missing CLAWHUB_TOKEN secret - Add changeset file --------- Co-authored-by: jpoehnelt-bot <jpoehnelt-bot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@googleworkspace/cli": patch
|
||||
---
|
||||
|
||||
Add workflow to publish OpenClaw skills to ClawHub
|
||||
@@ -0,0 +1,47 @@
|
||||
name: Publish OpenClaw Skills
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "skills/**"
|
||||
- ".github/workflows/publish-skills.yml"
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "skills/**"
|
||||
- ".github/workflows/publish-skills.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "20"
|
||||
|
||||
- name: Install ClawHub CLI
|
||||
run: npm i -g clawhub@0.7.0
|
||||
|
||||
- name: Publish skills
|
||||
env:
|
||||
CLAWHUB_TOKEN: ${{ secrets.CLAWHUB_TOKEN }}
|
||||
run: |
|
||||
if [ -z "$CLAWHUB_TOKEN" ]; then
|
||||
echo "::error::CLAWHUB_TOKEN secret is not set"
|
||||
exit 1
|
||||
fi
|
||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
||||
clawhub sync --root skills --all --dry-run
|
||||
else
|
||||
clawhub sync --root skills --all
|
||||
fi
|
||||
Reference in New Issue
Block a user