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.
Fix CI workflow deprecations and streamline build process #543
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
base: main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Fix CI workflow deprecations and streamline build process #543
Changes from all commits
00ba1a210db9bd06e94a8da67e83File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
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 | 🟠 Major | ⚡ Quick win
github.ref_nameinterpolated directly into shell scripts.The version-stamp
awkcommand (Line 33), zip/mv commands (Lines 47-48), and hash calculation (Line 69) all expand${{ github.ref_name }}directly insiderun:blocks. Sinceref_namecomes from the triggering ref/tag, this is a template/command-injection vector flagged by zizmor. The safer pattern (used later inbuild-windows's version-stamp step) is to pass the value viaenv:and reference the shell variable instead.🔒 Example fix pattern
Apply the same
env:-based pattern to the zip and hash-calc steps.🧰 Tools
🪛 zizmor (1.26.1)
[warning] 8-69: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
[error] 33-33: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[error] 47-47: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[error] 48-48: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[error] 69-69: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[warning] 52-52: action or reusable workflow from archived repository (archived-uses): repository is archived
(archived-uses)
🤖 Prompt for AI Agents
Source: Linters/SAST tools
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.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
sed -n '1,140p' .github/workflows/build-on-release.ymlRepository: robusta-dev/krr
Length of output: 4568
🏁 Script executed:
rg -n "actions/checkout@v2|actions/setup-python@v2|GITHUB_REF_NAME|persist-credentials" .github/workflows/build-on-release.ymlRepository: robusta-dev/krr
Length of output: 609
🌐 Web query:
actions/checkout v2 node12 deprecation setup-python v2 node12 actionlint💡 Result:
The use of Node.js 12 in GitHub Actions has been fully deprecated and removed from GitHub-hosted runners [1]. GitHub officially removed Node.js 12 from the Actions runner on August 14, 2023 [1]. Before this removal, GitHub migrated actions to Node.js 16 to ensure compatibility, and warned users to update their workflows [1]. Consequently, actions like actions/checkout@v2 and actions/setup-python@v2, which were originally built on Node.js 12, are considered outdated and should be updated to their newer versions (e.g., v4 or later) to avoid runtime issues and deprecation warnings [2][3][4]. To manage these dependencies, the static analysis tool actionlint includes a specific check for outdated actions [5][6]. It flags the use of popular actions that still rely on unsupported runtimes like Node.js 12 [5][6]. Specifically, actionlint reports an error if it detects usage such as actions/checkout@v2 because of its outdated runtime [5][6]. To resolve these issues, you should: 1. Update your GitHub Actions workflow files to use the latest major versions of all actions [3][4]. 2. Run actionlint in your local development environment or CI pipeline to identify and catch other instances of outdated actions or syntax errors [5][6].
Citations:
🏁 Script executed:
sed -n '140,420p' .github/workflows/build-on-release.ymlRepository: robusta-dev/krr
Length of output: 8901
Upgrade the Windows job off the deprecated v2 actions.
actions/checkout@v2andactions/setup-python@v2are still pinned here; move them to current majors so this job doesn’t depend on the removed node12 runtime. If this job never pushes back to the repo, setpersist-credentials: falseon checkout too.🧰 Tools
🪛 actionlint (1.7.12)
[error] 75-75: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
[error] 78-78: the runner of "actions/setup-python@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 zizmor (1.26.1)
[warning] 75-75: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[warning] 71-127: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
🤖 Prompt for AI Agents
Source: Linters/SAST tools
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 | 🟠 Major | ⚡ Quick win
Same template-injection and archived-action findings apply here.
Lines 109-110 expand
${{ github.ref_name }}directly in theCompress-Archive/Move-Itemrun block (same class of issue as the Ubuntu job); Line 114 uses the archivedactions/upload-release-asset@v1.0.2.🧰 Tools
🪛 zizmor (1.26.1)
[error] 109-109: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[error] 110-110: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[warning] 114-114: action or reusable workflow from archived repository (archived-uses): repository is archived
(archived-uses)
🤖 Prompt for AI Agents
Source: Linters/SAST tools
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 | 🟠 Major | ⚡ Quick win
Template injection repeats in the macOS build/zip/hash steps.
Lines 179, 193-194, and 215 expand
${{ github.ref_name }}directly insiderun:blocks, the same anti-pattern flagged in the Ubuntu and Windows jobs.🧰 Tools
🪛 zizmor (1.26.1)
[error] 179-179: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[error] 193-193: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[error] 194-194: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[error] 215-215: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[warning] 198-198: action or reusable workflow from archived repository (archived-uses): repository is archived
(archived-uses)
🤖 Prompt for AI Agents
Source: Linters/SAST tools
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.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Outdated GitHub Actions and checkout credential persistence
actions/checkout@v2andactions/setup-python@v2are still pinned here, andcheckoutshould disable credential persistence if the job doesn’t need repo write access.🧰 Tools
🪛 actionlint (1.7.12)
[error] 227-227: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
[error] 230-230: the runner of "actions/setup-python@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 zizmor (1.26.1)
[warning] 227-227: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[warning] 223-309: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
🤖 Prompt for AI Agents
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 | 🟠 Major | ⚡ Quick win
Same template-injection and archived-action findings in build-macos-intel.
Lines 271, 285-286 expand
${{ github.ref_name }}directly inrun:blocks; Line 290 uses the archivedactions/upload-release-asset@v1.0.2.🧰 Tools
🪛 zizmor (1.26.1)
[error] 271-271: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[error] 285-285: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[error] 286-286: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[warning] 290-290: action or reusable workflow from archived repository (archived-uses): repository is archived
(archived-uses)
🤖 Prompt for AI Agents
Source: Linters/SAST tools
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.
🗄️ Data Integrity & Integration | 🔴 Critical | ⚡ Quick win
🧩 Analysis chain
🌐 Web query:
Are GitHub Actions job outputs always strings, and how doesif:evaluate a bare string like "false"?💡 Result:
In GitHub Actions, job outputs are always stored and retrieved as strings [1][2]. Even if you set an output to a boolean or numeric value, it is serialized into its string representation (e.g., the boolean false becomes the string "false") when written to the GITHUB_OUTPUT environment file or accessed via the job outputs context [1]. Regarding your second question, how an if conditional evaluates a bare string like "false": In GitHub Actions, the if conditional is a special context where values are evaluated as expressions. When the runtime evaluates an if condition, it applies specific coercion rules to determine truthiness: 1. Truthy/Falsy Evaluation: Within an if conditional, GitHub Actions coerces values to booleans [3][4]. Falsy values are defined as false, 0, -0, "" (empty string), '', and null [3][4]. 2. String Interpretation: Because the string "false" is a non-empty string, it is considered truthy [3][4][5]. Therefore, if: false (as a boolean literal) evaluates to false, but if: "false" (as a string literal) evaluates to true [3][4][5]. To safely handle boolean outputs from previous jobs, you should convert the string back into a boolean within the expression using the fromJSON function [3][4]. For example, instead of using if: ${{ needs.job1.outputs.my_output }}, which would evaluate the string "false" as true, you should use: if: ${{ fromJSON(needs.job1.outputs.my_output) }} This converts the string "false" into the boolean false, allowing the condition to be evaluated as expected [3][4].
Citations:
🏁 Script executed:
Repository: robusta-dev/krr
Length of output: 1902
Gate
update-formulaon an explicit boolean checkneeds.check-latest.outputs.IS_LATESTis a string, so this bareif:treats"false"as truthy and still runsupdate-formulaon non-latest releases. That can overwrite the Homebrew formula with stale hashes/URLs.Suggested fix
update-formula: needs: [check-latest, build-macos, build-ubuntu] runs-on: ubuntu-latest - if: needs.check-latest.outputs.IS_LATEST + if: needs.check-latest.outputs.IS_LATEST == 'true'📝 Committable suggestion
🤖 Prompt for AI Agents