diff --git a/.changeset/publish-skills-workflow.md b/.changeset/publish-skills-workflow.md new file mode 100644 index 00000000..3ca8b779 --- /dev/null +++ b/.changeset/publish-skills-workflow.md @@ -0,0 +1,5 @@ +--- +"@googleworkspace/cli": patch +--- + +Add workflow to publish OpenClaw skills to ClawHub diff --git a/.github/workflows/publish-skills.yml b/.github/workflows/publish-skills.yml new file mode 100644 index 00000000..5d18dd2e --- /dev/null +++ b/.github/workflows/publish-skills.yml @@ -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