Update Index #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Index | |
| on: | |
| push: | |
| branches: [main] | |
| paths: ['skills/**'] | |
| schedule: | |
| - cron: '0 4 * * 1' # Every Monday 04:00 UTC | |
| workflow_dispatch: | |
| concurrency: | |
| group: update-index | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build skillshare-hub.json | |
| run: ./scripts/build.sh | |
| - name: Install skillshare CLI | |
| run: | | |
| curl -fsSL https://raw.githubusercontent.com/runkids/skillshare/main/install.sh | sh | |
| skillshare version | |
| - name: Audit all skills | |
| run: ./scripts/audit-all.sh | |
| - name: Generate README catalog | |
| run: ./scripts/readme.sh | |
| - name: Check for changes | |
| id: changes | |
| run: | | |
| if ! git diff --quiet skillshare-hub.json README.md; then | |
| echo "has_changes=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Create Pull Request | |
| if: steps.changes.outputs.has_changes == 'true' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| BRANCH="chore/update-index-$(date +%Y%m%d-%H%M%S)" | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git checkout -b "$BRANCH" | |
| git add skillshare-hub.json README.md | |
| git commit -m "chore: update audit scores and catalog" | |
| git push -u origin "$BRANCH" | |
| gh pr create \ | |
| --title "chore: update audit scores and catalog ($(date +%Y-%m-%d))" \ | |
| --body "Automated weekly update — audit scores and README catalog regenerated." |