-
Notifications
You must be signed in to change notification settings - Fork 20
ci(skills): require NVSkills validation for skill changes #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ngoncharenko
merged 10 commits into
main
from
ngoncharenko/aalgo-233-skills-update-guard
Jun 3, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2e41be6
ci: require NVSkills validation for skill changes
ngoncharenko 77d2b4e
test: trigger nvskills signature flow
ngoncharenko c695d49
test: touch skill for nvskills signature
ngoncharenko da58091
Attach NVSkills validation signatures
svc-nvskills-signing 8b3e11e
ci: match NVSkills signing actor
ngoncharenko 8544b3c
Attach NVSkills validation signatures
svc-nvskills-signing 4f0394f
test: remove temporary skill changes
ngoncharenko 7963fd6
ci: pin github-script action
ngoncharenko 3db8537
fix(ci): trust GitHub author for NVSkills signature
ngoncharenko 001edf4
Merge branch 'main' into ngoncharenko/aalgo-233-skills-update-guard
ngoncharenko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| name: Require NVSkills CI for skill changes | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
|
|
||
| jobs: | ||
| require-nvskills-ci: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Require trusted NVSkills signature for skills changes | ||
| uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7 | ||
| env: | ||
| SIGNATURE_ACTOR: ${{ vars.NVSKILLS_SIGNATURE_PUSH_ACTOR || 'svc-nvskills-signing' }} | ||
| SIGNATURE_TITLE: ${{ vars.NVSKILLS_SIGNATURE_COMMIT_TITLE || 'Attach NVSkills validation signatures' }} | ||
| ONBOARDING_DOC: https://nvidia.atlassian.net/wiki/spaces/GAIT/pages/3483240468/Github+First+-+Outbound+Repos+Onboarding+doc+-+NVCARPS#Review-Internal-Pipeline-Logs | ||
| with: | ||
| script: | | ||
| const pr = context.payload.pull_request; | ||
| const owner = context.repo.owner; | ||
| const repo = context.repo.repo; | ||
|
ngoncharenko marked this conversation as resolved.
|
||
|
|
||
| const files = await github.paginate(github.rest.pulls.listFiles, { | ||
| owner, | ||
| repo, | ||
| pull_number: pr.number, | ||
| per_page: 100, | ||
| }); | ||
|
|
||
| const touchedSkills = files.some((file) => file.filename.startsWith('skills/')); | ||
| if (!touchedSkills) { | ||
| core.info('No files under skills/ changed.'); | ||
| return; | ||
| } | ||
|
|
||
| const commit = await github.rest.repos.getCommit({ | ||
| owner, | ||
| repo, | ||
| ref: pr.head.sha, | ||
| }); | ||
|
|
||
| const actor = commit.data.author?.login || ''; | ||
| const title = commit.data.commit.message.split('\n')[0]; | ||
|
|
||
| const okActor = actor === process.env.SIGNATURE_ACTOR; | ||
| const okTitle = title.startsWith(process.env.SIGNATURE_TITLE); | ||
|
|
||
| if (!okActor || !okTitle) { | ||
| core.setFailed( | ||
| 'Files under skills/ changed in this PR, but HEAD is not the trusted NVSkills signature commit. ' + | ||
| 'Ask a maintainer/admin to comment /nvskills-ci. If new skills/ content was pushed after signing, rerun /nvskills-ci. ' + | ||
| `Expected HEAD GitHub author "${process.env.SIGNATURE_ACTOR}" and commit title prefix "${process.env.SIGNATURE_TITLE}". ` + | ||
| `See ${process.env.ONBOARDING_DOC}.` | ||
| ); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.