Skip to content

ci: pin GitHub Actions to commit SHAs with version comments - #28

Merged
shenxianpeng merged 1 commit into
commit-check:mainfrom
AshSgDe29071999:fix/26-pin-actions-version-comments
Aug 2, 2026
Merged

ci: pin GitHub Actions to commit SHAs with version comments#28
shenxianpeng merged 1 commit into
commit-check:mainfrom
AshSgDe29071999:fix/26-pin-actions-version-comments

Conversation

@AshSgDe29071999

@AshSgDe29071999 AshSgDe29071999 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Pin workflow actions to full commit hashes and annotate each pin with its release version (matching the commit-check org convention), for example actions/checkout@3d3c42e… # v7.0.1.

Fixes #26

Summary by CodeRabbit

  • Chores
    • Improved the security and reliability of automated test, build, and publishing workflows by pinning workflow actions to immutable versions.
    • Preserved existing workflow behavior and version labels for easier maintenance.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@AshSgDe29071999, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 57 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e4c43b6a-8679-43d7-993c-ad42356dd73f

📥 Commits

Reviewing files that changed from the base of the PR and between 146bc64 and 203da13.

📒 Files selected for processing (2)
  • .github/workflows/main.yml
  • .github/workflows/publish.yml
📝 Walkthrough

Walkthrough

Changes

Workflow action pinning

Layer / File(s) Summary
Test and build action pins
.github/workflows/main.yml
The test and build jobs pin GitHub Actions to commit SHAs and retain release-version comments.
Publishing workflow action pins
.github/workflows/publish.yml
The publish workflow pins checkout, setup, artifact, provenance, download, PyPI, and MCP Registry actions to commit SHAs with release-version comments.

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

Suggested reviewers: shenxianpeng

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The workflows pin GitHub Actions to commit SHAs and add release-version comments, satisfying issue #26.
Out of Scope Changes check ✅ Passed All changes are limited to GitHub Actions pinning and version comments described by issue #26.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes pinning GitHub Actions to commit SHAs with version comments.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codecov-commenter

codecov-commenter commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b1c61e4) to head (203da13).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #28   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          203       203           
=========================================
  Hits           203       203           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Match the commit-check org convention: pin mutable action tags to full
commit hashes and annotate each pin with its release version.
@AshSgDe29071999
AshSgDe29071999 force-pushed the fix/26-pin-actions-version-comments branch from 146bc64 to 203da13 Compare August 2, 2026 12:45

@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/main.yml:
- Line 27: Update all checkout steps in .github/workflows/main.yml lines 27-27
and 51-51, and .github/workflows/publish.yml lines 23-23 and 85-85, to set
persist-credentials to false; retain credential persistence only if a later step
in that job requires authenticated git commands.
🪄 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 Plus

Run ID: 31a07d5c-a6b3-4185-8ac3-dde16f72c900

📥 Commits

Reviewing files that changed from the base of the PR and between b1c61e4 and 146bc64.

📒 Files selected for processing (2)
  • .github/workflows/main.yml
  • .github/workflows/publish.yml

steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
- 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 -euo pipefail

echo "Tracked workflow files:"
git ls-files '.github/workflows/*.yml' '.github/workflows/*.yaml' || true

echo
echo "Relevant checkout steps in workflows:"
rg -n "uses: actions/checkout|persist-credentials|fetch-depth:|permissions:" .github/workflows || true

echo
echo "Workflow excerpts:"
for f in .github/workflows/main.yml .github/workflows/publish.yml; do
  if [ -f "$f" ]; then
    echo "--- $f ---"
    nl -ba "$f" | sed -n '1,140p'
  fi
done

echo
echo "Commit and local version:"
git rev-parse HEAD || true
git describe --tags --always --long 2>/dev/null || true

Repository: commit-check/commit-check-mcp

Length of output: 1409


🌐 Web query:

actions/checkout v4 persist-credentials default true default git credential helper README

💡 Result:

In the actions/checkout action, the persist-credentials input controls whether the authentication token or SSH key is configured for use by subsequent git commands in your workflow [1][2]. Key details regarding persist-credentials in actions/checkout: Default Behavior: The default value for persist-credentials is true [1][2][3]. When enabled, the action configures the runner's local git environment with the credentials, allowing your workflow scripts to execute authenticated git commands (such as git fetch or git push) without requiring additional configuration [4][5][3]. Security and Mechanism: - When persist-credentials is true, the action ensures that the authentication token or SSH key used to check out the repository is made available to git [4][3]. - In v4, the credentials were typically persisted in the local git config [4][5]. - Starting from v6.0.0, the action was updated to improve security by storing these credentials in a separate file within $RUNNER_TEMP rather than directly in the repository's.git/config [6][7]. This configuration is loaded using Git's includeIf mechanism [8]. - The credentials are removed during the post-job cleanup step to maintain security [4][5][3]. Opting Out: To disable this behavior, you can set persist-credentials to false in your workflow file [4][5]. This is recommended if you do not need to run authenticated git commands later in the job and want to strictly limit credential exposure [4][3]. Example usage: - uses: actions/checkout@v4 with: persist-credentials: false

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "main.yml relevant context:"
awk '{printf "%5d  %s\n", NR, $0}' .github/workflows/main.yml | sed -n '1,100p'

echo
echo "publish.yml relevant context:"
awk '{printf "%5d  %s\n", NR, $0}' .github/workflows/publish.yml | sed -n '1,130p'

echo
echo "Extract checkout steps and later git-related commands in each workflow:"
python3 - <<'PY'
from pathlib import Path
import re
for path in [Path(".github/workflows/main.yml"), Path(".github/workflows/publish.yml")]:
    print(f"--- {path} ---")
    text = path.read_text()
    lines = text.splitlines()
    in_checkout_with = False
    checkout_lineno = None
    for i, line in enumerate(lines, 1):
        if re.search(r"uses:\s*actions/checkout@", line):
            in_checkout_with = True
            checkout_lineno = i
            print(f"checkout {i}: {line}")
        elif in_checkout_with and line.strip().startswith("- "):
            in_checkout_with = False
            print(f"  no persist-credentials=false in continuation lines before next list item")
        elif in_checkout_with:
            if "persist-credentials" in line:
                print(f"  {i}: {line.strip()}")
                in_checkout_with = False
    for i, line in enumerate(lines, 1):
        lower = line.lower()
        if re.search(r"\bgit\s+", line) or lower.startswith("git ") or "gh release" in line:
            print(f"git-related {i}: {line.strip()}")
PY

Repository: commit-check/commit-check-mcp

Length of output: 7851


🌐 Web query:

github modelcontextprotocol registry mcp-publisher release mcp-publisher server.json branch master default branch

💡 Result:

The mcp-publisher is the official command-line interface tool used to interact with the Model Context Protocol (MCP) Registry [1][2]. It is developed and hosted within the modelcontextprotocol/registry repository on GitHub [3][4]. Key details regarding your query include: Default Branch: The default branch for the modelcontextprotocol/registry repository is main [3][5]. server.json Usage: The mcp-publisher tool uses a server.json file to describe MCP servers for registration, client discovery, and package management [6][7]. When using the publish command, the tool defaults to looking for a server.json file in the current directory (or you can specify a custom path using the --file or PATH argument) [4][1][2]. For developers, the tool provides several commands, including: mcp-publisher init: Creates a server.json file with auto-detected values [4][2]. mcp-publisher login: Authenticates the user, supporting methods such as GitHub OAuth, GitHub OIDC, and domain verification (DNS/HTTP) [3][4][5]. mcp-publisher publish: Validates the server.json against the required schema and publishes it to the MCP Registry [4][7]. For more information, you can refer to the official documentation within the registry repository or the Model Context Protocol website [3][2].

Citations:


Disable checkout credential persistence in every workflow job.

All four checkout steps use the default persisted GitHub token; set persist-credentials: false unless a later job step requires authenticated git commands.

🧰 Tools
🪛 zizmor (1.28.0)

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

(artipacked)

📍 Affects 2 files
  • .github/workflows/main.yml#L27-L27 (this comment)
  • .github/workflows/main.yml#L51-L51
  • .github/workflows/publish.yml#L23-L23
  • .github/workflows/publish.yml#L85-L85
🤖 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/main.yml at line 27, Update all checkout steps in
.github/workflows/main.yml lines 27-27 and 51-51, and
.github/workflows/publish.yml lines 23-23 and 85-85, to set persist-credentials
to false; retain credential persistence only if a later step in that job
requires authenticated git commands.

Source: Linters/SAST tools

@shenxianpeng
shenxianpeng merged commit 624c38a into commit-check:main Aug 2, 2026
6 of 7 checks passed
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.

Add version comments to pinned commit hashes

3 participants