Skip to content

Merge pull request #320 from vercel-labs/zeejab/agent-skills-discover… #4

Merge pull request #320 from vercel-labs/zeejab/agent-skills-discover…

Merge pull request #320 from vercel-labs/zeejab/agent-skills-discover… #4

name: Agent Skills Discovery
on:
pull_request:
branches: [main]
paths:
- 'skills/**'
- 'scripts/build-discovery-index.mjs'
- '.github/workflows/agent-skills-discovery.yml'
push:
branches: [main]
paths:
- 'skills/**'
- 'scripts/build-discovery-index.mjs'
- '.github/workflows/agent-skills-discovery.yml'
jobs:
validate:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- run: npm ci --ignore-scripts
- run: node scripts/build-discovery-index.mjs https://example.com/skills
publish:
if: github.event_name == 'push'
needs: validate
concurrency:
group: agent-skills-discovery-publish
cancel-in-progress: true
runs-on: ubuntu-latest
permissions:
contents: write
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: agent-skills-${{ github.sha }}
steps:
- uses: actions/checkout@v4
- run: npm ci --ignore-scripts
- run: node scripts/build-discovery-index.mjs "https://github.com/${{ github.repository }}/releases/download/${RELEASE_TAG}"
- run: |
gh release view "$RELEASE_TAG" >/dev/null 2>&1 ||
gh release create "$RELEASE_TAG" --draft --target "$GITHUB_SHA" \
--title "Agent Skills ${{ github.sha }}" \
--notes "Automated Agent Skills discovery release for ${{ github.sha }}."
gh release upload "$RELEASE_TAG" dist/* --clobber
gh release edit "$RELEASE_TAG" --draft=false --latest