Skip to content

pin GitHub Actions - #100

Merged
shogo82148 merged 1 commit into
mainfrom
pin-github-actions
Jul 31, 2026
Merged

pin GitHub Actions#100
shogo82148 merged 1 commit into
mainfrom
pin-github-actions

Conversation

@shogo82148

@shogo82148 shogo82148 commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Chores
    • Improved workflow security and reproducibility by pinning automation actions to immutable commit versions.
    • Updated code analysis, fuzz testing, and Go workflows to use fixed action revisions.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This pull request pins GitHub Actions references in three workflow files (codeql-analysis.yml, fuzz.yml, go.yml) to specific commit SHAs instead of floating version tags. This applies to checkout, setup-go, CodeQL, and go-fuzz actions.

Changes

CI Action Pinning

Layer / File(s) Summary
CodeQL workflow action pinning
.github/workflows/codeql-analysis.yml
Checkout is pinned to the v7.0.1 commit. CodeQL init, autobuild, and analyze actions are pinned to the v4.37.4 commit.
Fuzz workflow action pinning
.github/workflows/fuzz.yml
Checkout, Go setup, and go-fuzz actions are pinned to commit SHAs in both the list job and the fuzz job.
Go build workflow action pinning
.github/workflows/go.yml
actions/checkout and actions/setup-go are pinned to commit SHAs for versions 7.0.1 and 7.0.0.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'pin GitHub Actions' directly and concisely describes the main change across all modified workflow files, which pin action references to specific commit SHAs instead of floating version tags.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pin-github-actions

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with 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.

Inline comments:
In @.github/workflows/fuzz.yml:
- Line 16: Update both actions/checkout steps in the fuzz jobs to set
persist-credentials to false. Keep the existing checkout references and job
behavior unchanged while ensuring neither checkout leaves credentials available
to subsequent steps.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 244cdec2-c5d9-4ffd-8af4-6b47638ca9b0

📥 Commits

Reviewing files that changed from the base of the PR and between d064bf1 and 17c3d07.

📒 Files selected for processing (3)
  • .github/workflows/codeql-analysis.yml
  • .github/workflows/fuzz.yml
  • .github/workflows/go.yml

steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

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 | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- workflow ---'
cat -n .github/workflows/fuzz.yml
printf '%s\n' '--- checkout and token references ---'
rg -n -C 3 'actions/checkout|persist-credentials|github.token|token:|git ' .github/workflows/fuzz.yml
printf '%s\n' '--- repository references to fuzz action ---'
rg -n -C 3 'go-fuzz|fuzz' .github/workflows/fuzz.yml

Repository: shogo82148/androidbinary

Length of output: 3378


🏁 Script executed:

#!/bin/bash
set -eu
python3 - <<'PY'
import json
import urllib.request

urls = {
    "run_action_yml": "https://raw.githubusercontent.com/shogo82148/actions-go-fuzz/7887fe2495518ecf2504c6ebdede1764dec11018/action.yml",
    "list_action_yml": "https://raw.githubusercontent.com/shogo82148/actions-go-fuzz/7887fe2495518ecf2504c6ebdede1764dec11018/list/action.yml",
    "checkout_action_yml": "https://raw.githubusercontent.com/actions/checkout/3d3c42e5aac5ba805825da76410c181273ba90b1/action.yml",
}
for name, url in urls.items():
    print(f"--- {name}: {url} ---")
    try:
        with urllib.request.urlopen(url, timeout=15) as response:
            print(response.read().decode("utf-8", "replace"))
    except Exception as exc:
        print(f"ERROR: {exc}")
PY

Repository: shogo82148/androidbinary

Length of output: 1000


🌐 Web query:

actions/checkout persist-credentials false documentation token local git config

💡 Result:

In GitHub Actions, the actions/checkout action uses the persist-credentials input to control how the repository's authentication token is handled during the job [1][2]. When persist-credentials is set to its default value of true, the action configures Git to use the authentication token for subsequent Git commands within that workflow job [1][3]. Historically, this meant the token was stored directly in the local Git configuration (.git/config) [4][5]. However, starting in version v6.0.0, actions/checkout improved security by storing these credentials in a separate file under $RUNNER_TEMP rather than directly in the local .git/config [5][6]. This change reduces the risk of accidental exposure, such as through artifact publishing or repository copies [7]. The token is removed during post-job cleanup [1][4]. When you set persist-credentials: false, the action opts out of this automatic configuration [1][2]. This means the authentication token is not persisted to the local Git configuration or any temporary file, effectively preventing subsequent Git commands in the same job from using that specific token automatically [1][4]. Use this setting if your workflow does not require authenticated Git operations after the initial checkout, or if you prefer to manage Git authentication manually for security reasons [8][7].

Citations:


🏁 Script executed:

#!/bin/bash
set -eu
python3 - <<'PY'
import urllib.request

urls = {
    "run_action_yml": "https://raw.githubusercontent.com/shogo82148/actions-go-fuzz/7887fe2495518ecf2504c6ebdede1764dec11018/action.yml",
    "list_action_yml": "https://raw.githubusercontent.com/shogo82148/actions-go-fuzz/7887fe2495518ecf2504c6ebdede1764dec11018/list/action.yml",
    "checkout_action_yml": "https://raw.githubusercontent.com/actions/checkout/3d3c42e5aac5ba805825da76410c181273ba90b1/action.yml",
}
for name, url in urls.items():
    print(f"--- {name} ---")
    try:
        with urllib.request.urlopen(url, timeout=15) as response:
            print(response.read().decode("utf-8", "replace"))
    except Exception as exc:
        print(f"ERROR: {exc}")
PY

Repository: shogo82148/androidbinary

Length of output: 663


🏁 Script executed:

#!/bin/bash
set -eu
for spec in \
  "run_action_yml|https://raw.githubusercontent.com/shogo82148/actions-go-fuzz/7887fe2495518ecf2504c6ebdede1764dec11018/action.yml" \
  "list_action_yml|https://raw.githubusercontent.com/shogo82148/actions-go-fuzz/7887fe2495518ecf2504c6ebdede1764dec11018/list/action.yml" \
  "checkout_action_yml|https://raw.githubusercontent.com/actions/checkout/3d3c42e5aac5ba805825da76410c181273ba90b1/action.yml"
do
  name=${spec%%|*}
  url=${spec#*|}
  printf '%s\n' "--- $name ---"
  curl --fail --silent --show-error --location --insecure "$url"
  printf '\n'
done

Repository: shogo82148/androidbinary

Length of output: 6534


🌐 Web query:

site:github.com/shogo82148/actions-go-fuzz "token" "action.yml"

💡 Result:

In GitHub Actions, action.yml is a mandatory configuration file used to define metadata for a custom action [1]. It specifies the action's inputs, outputs, and execution instructions, allowing the action to be used in workflow files [1]. While there is no specific field in the action.yml schema exclusively named token, action authors frequently define an input named token to accept authentication credentials [2]. This allows users of the action to pass a GitHub token—such as the default GITHUB_TOKEN provided by the environment—into the action [2]. A typical example of defining such an input in an action.yml file looks like this: inputs: token: description: "The GitHub token for the repository" required: false default: ${{ github.token }} By convention, this input is often configured to default to the standard GitHub Actions token, which enables the action to perform authorized operations within the repository [2].

Citations:


🏁 Script executed:

#!/bin/bash
set -eu
for spec in \
  "run_dist|https://raw.githubusercontent.com/shogo82148/actions-go-fuzz/7887fe2495518ecf2504c6ebdede1764dec11018/dist/index.js" \
  "list_dist|https://raw.githubusercontent.com/shogo82148/actions-go-fuzz/7887fe2495518ecf2504c6ebdede1764dec11018/dist/list.js"
do
  name=${spec%%|*}
  url=${spec#*|}
  printf '%s\n' "--- $name ---"
  content=$(curl --fail --silent --show-error --location --insecure "$url")
  printf '%s\n' "$content" | rg -n -i -C 2 'git|credential|token|github|exec|spawn|go test|go list' || true
  printf '%s\n' "--- $name size ---"
  printf '%s' "$content" | wc -c
done

Repository: shogo82148/androidbinary

Length of output: 281


🏁 Script executed:

#!/bin/bash
set -eu
url='https://raw.githubusercontent.com/shogo82148/actions-go-fuzz/7887fe2495518ecf2504c6ebdede1764dec11018/dist/index.js'
curl -k -L --fail --silent --show-error "$url" -o /tmp/actions-go-fuzz-index.js
printf '%s\n' '--- references ---'
rg -n -i -C 2 'git|credential|token|github|exec|spawn|go test|go list' /tmp/actions-go-fuzz-index.js || true
printf '%s\n' '--- size ---'
wc -c /tmp/actions-go-fuzz-index.js

Repository: shogo82148/androidbinary

Length of output: 264


Disable checkout credential persistence in both fuzz jobs.

Set persist-credentials: false on both actions/checkout steps. Neither job performs an authenticated Git operation, and the jobs grant write permissions. This prevents subsequent actions and repository code from using the checkout credential.

🧰 Tools
🪛 zizmor (1.28.0)

[warning] 16-16: 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/fuzz.yml at line 16, Update both actions/checkout steps in
the fuzz jobs to set persist-credentials to false. Keep the existing checkout
references and job behavior unchanged while ensuring neither checkout leaves
credentials available to subsequent steps.

Source: Linters/SAST tools

@shogo82148
shogo82148 merged commit e621db6 into main Jul 31, 2026
23 checks passed
@shogo82148
shogo82148 deleted the pin-github-actions branch July 31, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant