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
20 changes: 11 additions & 9 deletions .github/workflows/package-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ on:
jobs:
release:
# Single workspace publish (rainix#191): one job bumps + publishes the
# rainlang crates in dependency order — bindings then dispair (both leaves
# on alloy). One commit, one push (via the PUBLISH_PRIVATE_KEY deploy key,
# which bypasses main's required-review protection), namespaced tags.
# rainlang crates in dependency order — bindings and dispair (leaves on
# alloy), then parser (depends on both). One commit, one push (via the
# PUBLISH_PRIVATE_KEY deploy key, which bypasses main's required-review
# protection), namespaced tags.
#
# rainlang_parser and rainlang-eval are not included yet:
# - parser's workspace deps (rainlang_bindings/dispair) need `version = ...`
# added before `cargo publish` accepts it (path-only today); fold it in
# once bindings + dispair are on crates.io.
# - eval has a foundry-evm git dep that blocks `cargo publish` entirely.
# The set releases as a unit (lockstep): a change to any member bumps and
# republishes all three, so parser's workspace pins on bindings/dispair are
# rewritten to the matching versions in the same cargo-release commit.
#
# rainlang-eval is still excluded — its foundry-evm git dep blocks
# `cargo publish` entirely.
uses: rainlanguage/rainix/.github/workflows/rainix-autopublish.yaml@main

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify mutable workflow refs and inherited secrets in GitHub workflows.
rg -nP --type=yaml '^\s*uses:\s*.+@main\s*$|^\s*secrets:\s*inherit\s*$' .github/workflows -C2

Repository: rainlanguage/rainlang

Length of output: 2393


Pin the reusable workflow ref and avoid inheriting all secrets.

.github/workflows/package-release.yaml uses rainix-autopublish.yaml@main (mutable ref) and forwards all secrets via secrets: inherit (broadens blast radius). Pin the workflow to a commit SHA and pass only the specific secrets required by the called workflow.

Suggested hardening
-    uses: rainlanguage/rainix/.github/workflows/rainix-autopublish.yaml@main
+    uses: rainlanguage/rainix/.github/workflows/rainix-autopublish.yaml@<commit-sha>
...
-    secrets: inherit
+    secrets:
+      PUBLISH_PRIVATE_KEY: ${{ secrets.PUBLISH_PRIVATE_KEY }}
🧰 Tools
🪛 zizmor (1.25.2)

[error] 20-20: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[warning] 20-20: secrets unconditionally inherited by called workflow (secrets-inherit): this reusable workflow

(secrets-inherit)

🤖 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/package-release.yaml at line 20, Update the reusable
workflow call that currently says "uses:
rainlanguage/rainix/.github/workflows/rainix-autopublish.yaml@main" to pin to an
exact commit SHA (replace `@main` with @<commit-sha>) and remove "secrets:
inherit"; instead explicitly pass only the required secrets by name (e.g.,
secrets: { NPM_TOKEN: ${{ secrets.NPM_TOKEN }}, GITHUB_TOKEN: ${{
secrets.GITHUB_TOKEN }} } or the exact secret names the called workflow
expects). Locate the invocation line with "rainix-autopublish.yaml@main" and the
"secrets: inherit" block in package-release.yaml and replace them accordingly so
the workflow uses a fixed ref and a minimal, explicit secrets mapping.

with:
crates: rainlang_bindings rainlang_dispair
crates: rainlang_bindings rainlang_dispair rainlang_parser
secrets: inherit
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ path = "crates/parser"

[workspace.dependencies.rainlang_dispair]
path = "crates/dispair"
version = "0.1.7"

[workspace.dependencies.rainlang_bindings]
path = "crates/bindings"
version = "0.1.12"

[workspace.dependencies.rainlang-eval]
path = "crates/eval"
Expand Down
Loading