|
6 | 6 | schedule: |
7 | 7 | - cron: "41 3 * * *" |
8 | 8 | workflow_dispatch: |
| 9 | + inputs: |
| 10 | + ref: |
| 11 | + description: Optional immutable codeguard-skills release tag |
| 12 | + required: false |
| 13 | + type: string |
| 14 | + sha: |
| 15 | + description: Required peeled commit SHA when ref is provided |
| 16 | + required: false |
| 17 | + type: string |
9 | 18 |
|
10 | 19 | permissions: |
11 | 20 | contents: write |
|
16 | 25 | runs-on: ubuntu-latest |
17 | 26 | env: |
18 | 27 | GH_TOKEN: ${{ secrets.SKILLS_SYNC_TOKEN || secrets.GITHUB_TOKEN }} |
| 28 | + REQUESTED_REF: ${{ github.event.client_payload.ref || inputs.ref }} |
| 29 | + REQUESTED_SHA: ${{ github.event.client_payload.sha || inputs.sha }} |
19 | 30 | steps: |
20 | 31 | - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 |
21 | 32 | with: |
|
24 | 35 | with: |
25 | 36 | python-version: "3.12" |
26 | 37 | - name: Vendor skills from pinned sources |
27 | | - run: python3 scripts/vendor/skill_vendor.py update |
| 38 | + shell: bash |
| 39 | + run: | |
| 40 | + arguments=(update) |
| 41 | + if [[ -n "$REQUESTED_REF" || -n "$REQUESTED_SHA" ]]; then |
| 42 | + if [[ -z "$REQUESTED_REF" || -z "$REQUESTED_SHA" ]]; then |
| 43 | + echo "::error::Both ref and sha are required for a release upgrade" |
| 44 | + exit 1 |
| 45 | + fi |
| 46 | + arguments+=(--source-ref "codeguard-skills=$REQUESTED_REF") |
| 47 | + arguments+=(--expected-sha "codeguard-skills=$REQUESTED_SHA") |
| 48 | + fi |
| 49 | + python3 scripts/vendor/skill_vendor.py "${arguments[@]}" |
28 | 50 | - name: Verify the fresh snapshot |
29 | 51 | run: python3 scripts/vendor/skill_vendor.py check |
30 | 52 | - name: Push a sync branch when the snapshot changed |
|
39 | 61 | git config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
40 | 62 | git checkout -B chore/skills-sync |
41 | 63 | git add skills/ skills.lock.json |
42 | | - git commit -m "chore: sync vendored skills from codeguard-skills" |
| 64 | + git commit -m "chore: sync vendored skills from codeguard-skills ${REQUESTED_REF:-current-lock}" |
43 | 65 | git push --force-with-lease origin chore/skills-sync |
44 | 66 | echo "changed=true" >> "$GITHUB_OUTPUT" |
45 | 67 | - name: Open the sync PR if none exists |
|
50 | 72 | exit 0 |
51 | 73 | fi |
52 | 74 | gh pr create \ |
53 | | - --title "chore: sync vendored Codeguard skills" \ |
54 | | - --body "Automated refresh of the checksummed skill snapshot from skills.lock.json. Externally managed skills come from full-stack-skills/codeguard-skills; unlisted plugin-local skills are preserved." \ |
| 75 | + --title "chore: sync vendored Codeguard skills ${REQUESTED_REF:-current-lock}" \ |
| 76 | + --body "Automated refresh of the checksummed skill snapshot from skills.lock.json. Requested release: ${REQUESTED_REF:-current lock}; expected commit: ${REQUESTED_SHA:-already pinned}. Externally managed skills come from full-stack-skills/codeguard-skills; plugin-local exceptions must be declared in plugin-local-skills.json." \ |
55 | 77 | --head chore/skills-sync --base main \ |
56 | 78 | --label skills-sync |
0 commit comments