Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/autobump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
autobump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@4f1f4aec02e41874fa0262ea8ff5172d7978ad1e # main
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
token: ${{ secrets.RELEASE_TOKEN }}
- uses: ruby/setup-ruby@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
build-macos:
runs-on: macos-14
steps:
- uses: actions/checkout@4f1f4aec02e41874fa0262ea8ff5172d7978ad1e # main
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

Copy link
Copy Markdown

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n## build.yml (lines 1-140)\n'
cat -n .github/workflows/build.yml | sed -n '1,140p'

printf '\n## Credential-dependent keywords in workflow\n'
rg -n "git push|git commit|gh |github.token|persist-credentials|checkout@" .github/workflows/build.yml

Repository: jdx/ruby

Length of output: 6448


Disable persisted checkout credentials in both build jobs.

These jobs only build, test, and upload artifacts, so the checkout token is unnecessary and widens the blast radius if a later step is compromised. Set persist-credentials: false on both actions/checkout steps.

🧰 Tools
🪛 zizmor (1.26.1)

[warning] 22-22: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build.yml at line 22, The checkout step in both build jobs
is persisting credentials unnecessarily, which should be disabled for safer
builds. Update each actions/checkout usage in the build workflow to set
persist-credentials to false, and make sure both build-job checkout steps are
changed consistently so no token remains available to later steps.

Source: Linters/SAST tools


- uses: ruby/setup-ruby@v1
id: setup-ruby
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
yjit: false
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@4f1f4aec02e41874fa0262ea8ff5172d7978ad1e # main
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
check-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@4f1f4aec02e41874fa0262ea8ff5172d7978ad1e # main
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

Copy link
Copy Markdown

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "## File overview"
git ls-files .github/workflows/release-new.yml

echo
echo "## Relevant lines with numbers"
cat -n .github/workflows/release-new.yml | sed -n '1,220p'

echo
echo "## Search for checkout usage and any git push / gh / release-related steps in workflow"
rg -n "actions/checkout|persist-credentials|git push|gh |release|tag|push:" .github/workflows/release-new.yml

Repository: jdx/ruby

Length of output: 4736


Disable persisted checkout credentials here. This job only reads repository files and triggers gh workflows, so actions/checkout doesn’t need to leave its token in local git config.

Suggested change
       - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+        with:
+          persist-credentials: false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
🧰 Tools
🪛 zizmor (1.26.1)

[warning] 31-31: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release-new.yml at line 31, Disable persisted checkout
credentials in the release workflow by updating the actions/checkout step in the
release-new job so it does not leave the token in local git config. Since this
job only reads repository contents and invokes gh workflows, adjust the checkout
configuration on the existing actions/checkout step to avoid persisting
credentials while keeping the rest of the workflow unchanged.

Source: Linters/SAST tools

- uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
env:
VERSION: ${{ inputs.version }}
steps:
- uses: actions/checkout@4f1f4aec02e41874fa0262ea8ff5172d7978ad1e # main
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Determine build revision
id: revision
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
syntax:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@4f1f4aec02e41874fa0262ea8ff5172d7978ad1e # main
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

Copy link
Copy Markdown

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

git ls-files .github/workflows/tests.yml
wc -l .github/workflows/tests.yml
cat -n .github/workflows/tests.yml | sed -n '1,220p'

Repository: jdx/ruby

Length of output: 1631


Drop persisted checkout credentials in the syntax job.

actions/checkout leaves the token in the repo config by default. This job only validates recipes and Ruby syntax, so set persist-credentials: false to avoid keeping git auth around.

Suggested change
       - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+        with:
+          persist-credentials: false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
🧰 Tools
🪛 zizmor (1.26.1)

[warning] 20-20: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/tests.yml at line 20, In the syntax job using
actions/checkout, the repository token is still being persisted in git config by
default; update the checkout step to disable persisted credentials. Adjust the
checkout configuration in the workflow so the syntax/recipe validation job
explicitly sets persist-credentials to false on the actions/checkout step.

Source: Linters/SAST tools

- uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
Expand Down