GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — ci: pin GitHub Actions to commit SHAs by StevenMcClankerton · Pull Request #29951 · prisma/orm Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughGitHub Actions references across composite actions and workflows are pinned to immutable commit SHAs. The ChangesGitHub Actions SHA pinning
Dependency constraint updates
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
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/pr-code-security.yml:
- Around line 10-11: Replace secrets: inherit in the reusable
secret_detection.yml workflow invocation with an explicit secrets mapping that
forwards only GITHUB_TOKEN and GITLEAKS_LICENSE, preserving the existing pinned
workflow reference.
In @.github/workflows/publish.yml:
- Line 91: Disable checkout credential persistence for every listed
actions/checkout site by adding persist-credentials: false:
.github/workflows/publish.yml:91, benchmark.yml:56, bundle-size.yml:30,
lint-workflow-files.yml:11, test.yml:48, v7-manage-dist-tag.yml:34,
v7-update-engines-version.yml:30, v7-update-studio-version.yml:16, and all
listed checkout sites in test-template.yml (67, 120, 172, 240, 307, 362, 422,
467, 537, 565, 610, 636, 672, 710, 748, 789, 815, 898, 953, 977, 1016, 1079). In
build-engine-branch.yml:53, add the setting within the existing with block.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Path: .coderabbit.yml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 2ebd6d13-2023-4b07-81ed-53b9ad06e7fc
.github/actions/create-git-tag/action.yml.github/actions/setup/action.yml.github/workflows/benchmark.yml.github/workflows/build-engine-branch.yml.github/workflows/bundle-size.yml.github/workflows/lint-workflow-files.yml.github/workflows/pr-code-security.yml.github/workflows/publish.yml.github/workflows/test-template.yml.github/workflows/test.yml.github/workflows/v7-manage-dist-tag.yml.github/workflows/v7-update-engines-version.yml.github/workflows/v7-update-studio-version.yml
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| uses: prisma/.github/.github/workflows/secret_detection.yml@7e808313ce87dfbd166654e9819606097a68d8c8 # main | ||
| secrets: inherit |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "== workflow call ==" sed -n '1,80p' .github/workflows/pr-code-security.yml echo echo "== searched refs ==" rg -n "secret_detection|workflow_call|secrets: inherit|workflow_call\.secrets|uses: prisma/.github/.github/workflows/secret_detection" .github README.md 2>/dev/null || true echo echo "== local files ==" git ls-files '.github/workflows/*.yml' .github/workflows/pr-code-security.yml .github/workflows/secret_detection.yml
Repository: prisma/prisma
Length of output: 1653
🏁 Script executed:
#!/bin/bash set -euo pipefail tmp="$(mktemp -d)" cd "$tmp" echo "== GitHub release refs for prisma/prisma ==" git ls-remote --tags [email protected]:prisma/prisma.git 'refs/tags/*' \ | awk '{print $2}' \ | sed 's#refs/tags/##' \ | rg '^(main|v[0-9]+|release|stable|\.github)' | head -80 || true echo echo "== GitHub ref for prisma/.github repo main/tag candidates ==" for ref in main v7.0.0 v7.1.0 v7.2.0 stable latest; do echo "-- $ref" curl -fsSL --max-time 15 "https://api.github.com/repos/prisma/.github/git/ref/heads/$ref" | jq -r '{ref, object_type: .object.type, object_sha: .object.sha, tag: .tag}' 2>/dev/null || echo "fetch failed" curl -fsSL --max-time 15 "https://api.github.com/repos/prisma/.github/git/refs/tags/$ref" | jq -r '{ref, object_type: .object.type, object_sha: .object.sha}' 2>/dev/null || true done echo echo "== Try direct raw SHA and possible branch/raw HEAD paths for secret_detection workflow ==" for path in \ "7e808313ce87dfbd166654e9819606097a68d8c8/.github/workflows/secret_detection.yml" \ "main/.github/workflows/secret_detection.yml" \ "v7/.github/workflows/secret_detection.yml" \ "7e808313ce87dfbd166654e9819606097a68d8c8/workflows/secret_detection.yml" \ "main/workflows/secret_detection.yml"; do echo "-- $path" curl -fsSL --max-time 15 "https://raw.githubusercontent.com/prisma/.github/$path" \ | sed -n '1,140p' || echo "fetch failed" done
Repository: prisma/prisma
Length of output: 3562
🌐 Web query:
GitHub Actions reusable workflows secrets inherit called workflow workflow_call.secrets
💡 Result:
In GitHub Actions, secrets are not automatically passed to reusable workflows; they must be explicitly forwarded by the calling workflow using either a map or the inherit keyword [1][2]. The secrets: inherit keyword allows a calling workflow to pass all of its available secrets to a directly called reusable workflow [3][4]. This feature is particularly useful for reducing boilerplate when many secrets are required, as it avoids the need to list each secret individually [5]. Key considerations and behavior: 1. Usage: You apply the inherit keyword in the job definition of the calling workflow: jobs: call-workflow: uses: owner/repo/.github/workflows/reusable.yml@main secrets: inherit 2. Explicit Declaration: While you can use secrets: inherit to pass secrets without defining them in the reusable workflow's workflow_call block, it is best practice to declare the expected secrets in the reusable workflow's on.workflow_call.secrets definition [3][1]. If you use inherit, you can reference these secrets in your reusable workflow even if they are not explicitly defined in the on key, but declaring them remains recommended for clarity and validation [3][4]. 3. Non-Transitive Inheritance: Inheritance is not transitive across nested workflows [3][4][2]. In a workflow chain (A > B > C), if workflow A calls B using secrets: inherit, workflow B receives those secrets, but workflow C will not automatically receive them from A. Workflow B must explicitly pass or inherit the secrets to workflow C [3][2]. 4. Security and Constraints: The inherit keyword is primarily available for workflows within the same organization or enterprise [3][6]. Because it passes all available secrets from the caller to the callee, it should be used carefully to ensure that the called workflow is trusted to access all those secrets [2]. If you choose not to use inherit, you must explicitly map each secret in the calling workflow's secrets block: jobs: call-workflow: uses: owner/repo/.github/workflows/reusable.yml@main secrets: MY_SECRET: ${{ secrets.MY_SECRET }}
Citations:
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "== pr-code-security.yml context ==" cat -n .github/workflows/pr-code-security.yml echo echo "== workflow_call secrets declarations nearby ==" python3 - <<'PY' import pathlib, re for p in pathlib.Path(".github/workflows").glob("*.yml"): txt = p.read_text() if re.search(r"workflow_call:\s*$", txt, re.M): if re.search(r"secrets:\s*inherit|secrets:\s*\{|\n\s*\w+:", txt): print(f"-- {p}") for line_no, line in enumerate(txt.splitlines(), 1): if "workflow_call:" in line or "secrets:" in line or "GITLEAKS_LICENSE" in line or "uses:" in line: print(f"{line_no}: {line}") print() PY echo echo "== YAML workflow_call secrets schema extraction for pr-code-security.yml ==" python3 - <<'PY' import pathlib from collections import defaultdict, deque p = pathlib.Path(".github/workflows/pr-code-security.yml") lines = p.read_text().splitlines() for i, line in enumerate(lines, 1): if "uses: prisma/.github/.github/workflows/secret_detection.yml" in line: indent = len(line) - len(line.lstrip()) in_secrets = False base = indent mapping = {} for j in range(i, min(i+10, len(lines)+1)): cur = lines[j-1] cur_indent = len(cur) - len(cur.lstrip()) text = cur.strip() if j > i: if cur_indent and cur_indent <= base: break if text == "secrets: inherit": in_secrets = True mapping["inherit"] = True elif in_secrets and text.startswith(("secrets:", "$")): pass elif re := re.match(r"(\w+): \${{\s*secrets\.(\w+)\s*}}", cur.strip()): mapping[re.group(1)] = re.group(2) print(i, "secrets_mapping", mapping if map else "none") PY
Repository: prisma/prisma
Length of output: 6191
Pass only the secrets required by secret_detection.yml.
secrets: inherit gives the reusable workflow every secret available to this workflow. The pinned reusable workflow reads GITHUB_TOKEN and GITLEAKS_LICENSE, so forward only those names instead of using inherit.
[warning] 8-11: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
[warning] 10-10: secrets unconditionally inherited by called workflow (secrets-inherit): this reusable workflow
(secrets-inherit)
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/pr-code-security.yml around lines 10 - 11, Replace
secrets: inherit in the reusable secret_detection.yml workflow invocation with
an explicit secrets mapping that forwards only GITHUB_TOKEN and
GITLEAKS_LICENSE, preserving the existing pinned workflow reference.
Source: Linters/SAST tools
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Out of scope
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@SevInf, acknowledged. This change is outside the scope of the SHA-pinning pull request.
Would you like me to create a follow-up GitHub issue for the secrets: inherit restriction?
You are interacting with an AI system.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
size-limit report 📦
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Backport of #29951 to the 7.9.x release branch. Pins the remote GitHub Actions used by the backported CI configuration to immutable commit SHAs and updates the vulnerable `fast-uri` and `nanoid` dependencies. ## Verification - `pnpm install --lockfile-only --offline` - `git diff --check origin/7.9.x..HEAD` --------- Co-authored-by: Steven McClankerton <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.