|
| 1 | +# DO NOT EDIT: BEGIN |
| 2 | +# This snippet has been inserted automatically by mobsuccessbot, do not edit! |
| 3 | +# If changes are needed, update the action skills in |
| 4 | +# https://github.com/mobsuccess-devops/github-mobsuccess-policy |
| 5 | +name: Update Skills |
| 6 | + |
| 7 | +on: |
| 8 | + schedule: |
| 9 | + - cron: "0 9 * * *" |
| 10 | + timezone: "Europe/Paris" |
| 11 | + workflow_dispatch: |
| 12 | + |
| 13 | +jobs: |
| 14 | + update-skills: |
| 15 | + name: Update Skills |
| 16 | + runs-on: ubuntu-slim |
| 17 | + permissions: |
| 18 | + contents: write |
| 19 | + pull-requests: write |
| 20 | + steps: |
| 21 | + - name: Get bot token |
| 22 | + id: get_token |
| 23 | + uses: actions/create-github-app-token@v3 |
| 24 | + with: |
| 25 | + repositories: ${{ github.event.repository.name }},skills-hub |
| 26 | + owner: ${{ github.repository_owner }} |
| 27 | + client-id: ${{ secrets.MS_RENOVATE_APP_ID }} |
| 28 | + private-key: ${{ secrets.MS_RENOVATE_APP_PRIVATE_KEY }} |
| 29 | + |
| 30 | + - uses: actions/checkout@v7 |
| 31 | + |
| 32 | + - uses: actions/setup-node@v7 |
| 33 | + |
| 34 | + - name: Configure git credentials |
| 35 | + run: git config --global url."https://x-access-token:${{ steps.get_token.outputs.token }}@github.com/".insteadOf "https://github.com/" |
| 36 | + |
| 37 | + - name: Update skills |
| 38 | + run: | |
| 39 | + if [ -f "ai-lock.json" ]; then |
| 40 | + echo "@mobsuccess-devops:registry=https://npm.pkg.github.com" >> ~/.npmrc |
| 41 | + echo "//npm.pkg.github.com/:_authToken=${{ secrets.MS_READ_PACKAGES_GITHUB_PAT }}" >> ~/.npmrc |
| 42 | + GITHUB_TOKEN="${{ steps.get_token.outputs.token }}" npx --package=@mobsuccess-devops/skills-cli -- skills-cli update |
| 43 | + else |
| 44 | + export GITHUB_TOKEN="${{ steps.get_token.outputs.token }}" |
| 45 | + SKILLS=$(node -e " |
| 46 | + const lock = require('./skills-lock.json'); |
| 47 | + const names = Object.entries(lock.skills) |
| 48 | + .filter(([_, v]) => v.source === 'mobsuccess-devops/skills-hub') |
| 49 | + .map(([name]) => name); |
| 50 | + console.log(names.join(' ')); |
| 51 | + ") |
| 52 | + if [ -n "$SKILLS" ]; then |
| 53 | + npx skills add mobsuccess-devops/skills-hub --skill $SKILLS --agent claude-code cursor --yes |
| 54 | + fi |
| 55 | + fi |
| 56 | +
|
| 57 | + - name: Create PR if skills changed |
| 58 | + uses: peter-evans/create-pull-request@v8 |
| 59 | + with: |
| 60 | + token: ${{ steps.get_token.outputs.token }} |
| 61 | + commit-message: "chore(skills): update skills to latest versions" |
| 62 | + branch: chore/update-skills |
| 63 | + base: master |
| 64 | + title: "chore(skills): update skills to latest versions" |
| 65 | + body: | |
| 66 | + Automated update of skills to their latest versions. |
| 67 | +
|
| 68 | + This PR was created automatically by the [daily skills update workflow](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}). |
| 69 | + labels: automated |
| 70 | + delete-branch: true |
| 71 | +# DO NOT EDIT: END |
0 commit comments