Repository navigation
ci: trigger the release scan on GitHub release #1048
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
Closed
orbalayla-nvidia
wants to merge
3
commits into
NVIDIA:main
from
orbalayla-nvidia:ci/release-scan-trigger
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Triggers the CloudAI release scan when a GitHub release is published. | ||
| # published also fires for pre-releases, so release candidates are covered. | ||
| name: Release scan | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| jobs: | ||
| trigger: | ||
| name: Trigger release scan | ||
| # Jenkins is not reachable from GitHub-hosted runners. | ||
| runs-on: blossom | ||
|
|
||
| steps: | ||
| - name: Trigger release scan | ||
| env: | ||
| RELEASE_CI_SERVER: ${{ secrets.RELEASE_CI_SERVER }} | ||
| PAYLOAD: ${{ toJSON(github.event) }} | ||
| # Via env, not interpolated: a tag name is attacker-controlled text. | ||
| RELEASE_TAG: ${{ github.event.release.tag_name }} | ||
| run: | | ||
| set -eu | ||
|
|
||
| # The URL carries the trigger token, so refuse to send it in clear. | ||
| case "${RELEASE_CI_SERVER}" in | ||
| https://*) ;; | ||
| *) echo "RELEASE_CI_SERVER must be an https URL" >&2; exit 1 ;; | ||
| esac | ||
|
|
||
| curl --fail --silent --show-error --proto '=https' \ | ||
| --connect-timeout 15 --max-time 60 \ | ||
| -X POST "${RELEASE_CI_SERVER}" \ | ||
|
orbalayla-nvidia marked this conversation as resolved.
|
||
| -H 'Content-Type: application/json' \ | ||
| --data-raw "${PAYLOAD}" | ||
| echo "Release scan triggered for ${RELEASE_TAG}" | ||
This file was deleted.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: NVIDIA/cloudai
Length of output: 2135
Set
permissions: {}for the release workflow.This job only sends the release payload and does not use
GITHUB_TOKEN. Without an explicitpermissionssetting, GitHub applies the repository or organization default permissions. If that default grants repository scopes, the self-hosted job receives access it does not need.Suggested fix
on: release: types: [published] +permissions: {} + jobs:🧰 Tools
🪛 zizmor (1.30.0)
[warning] 3-37: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
[warning] 5-7: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting
(concurrency-limits)
🤖 Prompt for AI Agents