Skip to content

ci(release): add automated release workflow with nx release#924

Open
shaharkazaz wants to merge 4 commits into
masterfrom
ci/release-workflow
Open

ci(release): add automated release workflow with nx release#924
shaharkazaz wants to merge 4 commits into
masterfrom
ci/release-workflow

Conversation

@shaharkazaz
Copy link
Copy Markdown
Collaborator

@shaharkazaz shaharkazaz commented May 25, 2026

Summary

Replaces the manual local-dev/publish-all-libs.sh flow with a GitHub Actions workflow that drives nx release end-to-end, plus an actionlint workflow to lint workflow YAML on PR.

Release workflow (.github/workflows/release.yml)

  • Trigger: workflow_dispatch with two inputs — bump (auto = infer from conventional commits; or patch/minor/major/prerelease) and dry-run (preview without side effects)
  • Auth: npm OIDC trusted publishing (no NPM_TOKEN secret needed), with --provenance attestations via NPM_CONFIG_PROVENANCE=true
  • Test gate: ci:lintci:testci:build runs before any version bump or publish
  • Changelog: new workspaceChangelog block in nx.json writes the root CHANGELOG.md and creates one GitHub release per version (releases/X.Y.Z); existing per-project changelogs preserved
  • Ordering: versionpublishpushchangelog so a failed publish leaves a clean rollback (commit/tag local-only on the runner)

Actionlint workflow (.github/workflows/actionlint.yml)

Mirrors the cx-web-workspace pattern — pinned actionlint v1.7.12, cached at ~/bin/actionlint, installed only on cache miss. Triggers on PR + push to master when files under .github/workflows/** or .github/actions/** change.

Already paid for itself: caught two real bugs in release.yml during development —

  1. Empty-string '' as a workflow_dispatch choice option (invalid; would have failed at dispatch time). Switched to an explicit auto sentinel.
  2. Fragile \"-escaped node -p command substitution that shellcheck couldn't parse. Replaced with a two-line shell block.

Both fixes also hardened the workflow by moving every ${{ ... }} expression into env: blocks before it touches a shell — preventing GitHub Actions expression-injection patterns regardless of input type.

Security

Concern Mitigation
Cross-branch releases if: github.ref == 'refs/heads/master' job guard
Concurrent releases concurrency: { group: release, cancel-in-progress: false }
Token leakage OIDC trusted publishing — no static npm token in repo or runner
Tampered tarball --provenance flag emits signed attestation linking tarball → workflow run → commit
Expression injection in shell All ${{ ... }} interpolations routed through env: blocks, never inlined into run:
Over-broad CI perms Only contents: write (commit/tag/release) + id-token: write (OIDC). No packages: write.
Runaway publish 30-minute job timeout
Workflow YAML drift / regressions New actionlint workflow on every PR touching .github/

Pre-flight before first non-dry run

  • npm trusted publishing configured on npmjs.org for @jsverse/*, pointed at this repo + release.yml
  • Branch protection on master restricts who can dispatch workflows (or attach a GH Environment with required reviewers)
  • Sanity-check the auto-inferred bump: git log releases/8.3.0..HEAD --oneline
  • Run the workflow once with dry-run: true as the first real test

Test plan

  • Open this PR — actionlint workflow should run and pass
  • Trigger Release workflow on master with dry-run: true and bump: auto — verify auto-inferred bump matches expectation, no commits/tags/publishes occur
  • Trigger with dry-run: true and bump: patch — verify override path produces a patch bump preview
  • After OIDC config is in place, trigger with dry-run: false — verify packages publish with provenance, GH release is created, tag releases/X.Y.Z lands on master, root CHANGELOG.md updates

Follow-ups (intentionally out of scope)

  • schematics-core synclibs/schematics-core/ is currently copied into libs/transloco/schematics-core/ and libs/transloco-schematics/schematics-core/ via a manual gitignored script (local-dev/sync-schematics-core.sh). This isn't wired into any build target. With automated releases, drift between source and copies could ship silently. Fix proposed in a follow-up PR: move the script to a tracked scripts/ location, run it in ci.yml and release.yml before build, add a pre-commit guard that fails on drift.
  • reviewdog.yml deprecation — pre-existing usage of fail_on_error is deprecated in favor of fail_level. Surfaced by actionlint. Tracked for a separate cleanup PR.
  • Bump pre-existing workflow actionsci.yml, deploy-demo-app.yml, stale-issues.yml, and the step-setup composite still use older majors: actions/checkout@v4 (latest v6), actions/setup-node@v4 (latest v6), actions/stale@v9 (latest v10), actions/configure-pages@v5 (latest v6), actions/upload-pages-artifact@v3 (latest v5), actions/deploy-pages@v4 (latest v5). Worth a single chore PR. The new release/actionlint workflows in this PR are already on latest majors.
  • Action SHA pinning — All workflows currently use floating major tags. Hardening pass: pin to commit SHAs with Dependabot updates. Defeats tag-hijacking attacks.
  • Retire local-dev/publish-all-libs.sh — leaving in place as an emergency manual fallback for now.

Summary by CodeRabbit

  • Chores
    • Added a configurable, manually-triggerable release workflow with dry-run support, selectable version bump options, automated versioning, npm publish, changelog generation, and GitHub release creation.
    • Added an automated workflow to lint GitHub workflow files on relevant changes.
    • Configured workspace changelog integration to enable GitHub release creation and streamline release metadata.

Review Change Stack

- workflow_dispatch trigger with optional bump override and dry-run
- OIDC trusted publishing + npm provenance (id-token: write)
- Test gate (lint/test/build) before version/publish
- Concurrency lock + branch guard to master
- Workspace changelog wired to root CHANGELOG.md with one GH release per version

Supersedes the manual local-dev/publish-all-libs.sh flow.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

📝 Walkthrough

Walkthrough

Adds a Release GitHub Actions workflow (manual dispatch) that computes an Nx version, optionally publishes packages, pushes commit/tags, and creates changelogs/releases; adds an actionlint workflow for workflow files; updates nx.json to point workspace changelog to CHANGELOG.md.

Changes

Release Automation Workflow

Layer / File(s) Summary
Workflow trigger and environment preparation
.github/workflows/release.yml
Defines workflow_dispatch inputs (bump, dry-run), permissions and concurrency; checks out full repo with tags/history; sets up Node.js 20 (npm cache/registry), runs npm ci, sets git identity, and runs lint/test/build validation.
Version computation
.github/workflows/release.yml
Runs npx nx release version with conditional --dry-run and optional explicit bump argument; reads version from libs/transloco/package.json into a step output.
Publish, push, and changelog
.github/workflows/release.yml
When not a dry run, publishes via npx nx release publish --access public with provenance, conditionally pushes commit and tags to master, and runs npx nx release changelog <version> to generate changelog and GitHub release.
Execution summary & nx config
.github/workflows/release.yml, nx.json
Always writes a formatted run report (version, bump, dry-run, ref, actor) to $GITHUB_STEP_SUMMARY; adds release.workspaceChangelog in nx.json pointing to CHANGELOG.md and createRelease: "github".

Actionlint Workflow

Layer / File(s) Summary
Actionlint job
.github/workflows/actionlint.yml
Adds an actionlint workflow triggered on push/pull_request limited to .github/workflows/** and .github/actions/**, caches/installs actionlint v1.7.12, updates GITHUB_PATH, and runs actionlint -color.

Fun fact: "Transloco" helps apps show text across languages — in Spanish, "traducción" means "translation", a core i18n concept Transloco supports.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding an automated release workflow driven by nx release.
Description check ✅ Passed The PR description is comprehensive and well-structured, covering summary, technical details, security considerations, testing plan, and follow-ups despite not strictly following the template structure.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/release-workflow

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 and usage tips.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 25, 2026

Open in StackBlitz

@jsverse/transloco

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco@924

@jsverse/transloco-locale

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-locale@924

@jsverse/transloco-messageformat

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-messageformat@924

@jsverse/transloco-optimize

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-optimize@924

@jsverse/transloco-persist-lang

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-persist-lang@924

@jsverse/transloco-persist-translations

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-persist-translations@924

@jsverse/transloco-preload-langs

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-preload-langs@924

@jsverse/transloco-schematics

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-schematics@924

@jsverse/transloco-scoped-libs

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-scoped-libs@924

@jsverse/transloco-utils

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-utils@924

@jsverse/transloco-validator

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-validator@924

commit: 574c5e8

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
.github/workflows/release.yml (1)

38-38: ⚖️ Poor tradeoff

Consider pinning action to commit SHA for supply-chain security.

Using tag references (e.g., @v4) rather than commit SHAs makes the workflow vulnerable to tag manipulation attacks. For a security-sensitive release workflow, pinning to immutable commit SHAs is recommended.

🔐 Optional SHA pinning
-      - name: Checkout
-        uses: actions/checkout@v4
+      - name: Checkout
+        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

Apply the same pattern to line 45 (setup-node). You can use tools like pin-github-action or Dependabot to maintain pinned SHAs.

Fun fact: The word "security" comes from Latin securus (se- "without" + cura "care"). In Japanese, it's セキュリティ (sekyuriti), a direct loanword! 🔐

🤖 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.yml at line 38, Replace mutable tag refs with
immutable commit SHAs: update the uses: entry "actions/checkout@v4" to the
corresponding commit SHA (e.g., actions/checkout@<commit-sha>) and do the same
for the "actions/setup-node@vX" reference on the other line; locate these by the
literal strings "actions/checkout@v4" and "actions/setup-node" in the workflow,
fetch the correct pinned commit SHAs from the actions' GitHub repos (or use a
tool like pin-github-action/Dependabot), and update the workflow to use the full
commit SHAs to prevent tag manipulation.
🤖 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/release.yml:
- Around line 37-42: Update the checkout action (uses: actions/checkout@v4) to
add persist-credentials: false so the GITHUB_TOKEN is not persisted to the
workspace; then adjust the later push step that performs git push to use an
explicit token (e.g., a PAT from secrets) or perform a separate checkout
configured with credentials so pushes still work without relying on the
persisted GITHUB_TOKEN.
- Around line 78-80: The GitHub Actions step "Read version" (id: version) uses a
run line with improperly escaped double quotes causing shell parsing errors;
replace the current node -p invocation so the JS string is quoted safely (e.g.,
use single quotes around the node expression or wrap the whole run value as a
YAML block) to avoid backslashes—update the run for the "Read version" step to
call node -p with proper single-quoting of
"require('./libs/transloco/package.json').version" or convert the run to a
multiline/| block so no shell-escaping is necessary.
- Around line 11-12: Replace the invalid empty choice option by changing the
input from a choice to a string: remove the "options:" block that contains "-
''" and switch the input declaration to "type: string" (locate the "options"
entry in the workflow diff), then update the Version step's validation logic
(the step named "Version") to explicitly validate allowed values (e.g., via a
conditional or regex check) so only valid release values are accepted.

---

Nitpick comments:
In @.github/workflows/release.yml:
- Line 38: Replace mutable tag refs with immutable commit SHAs: update the uses:
entry "actions/checkout@v4" to the corresponding commit SHA (e.g.,
actions/checkout@<commit-sha>) and do the same for the "actions/setup-node@vX"
reference on the other line; locate these by the literal strings
"actions/checkout@v4" and "actions/setup-node" in the workflow, fetch the
correct pinned commit SHAs from the actions' GitHub repos (or use a tool like
pin-github-action/Dependabot), and update the workflow to use the full commit
SHAs to prevent tag manipulation.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 78646dfd-22b2-40c2-9d4b-f283c47f4a27

📥 Commits

Reviewing files that changed from the base of the PR and between 82ae7bb and 80319b2.

📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • nx.json

Comment thread .github/workflows/release.yml Outdated
Comment on lines +37 to +42
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
token: ${{ secrets.GITHUB_TOKEN }}
Copy link
Copy Markdown

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

Add persist-credentials: false to prevent credential leakage.

The checkout step should disable credential persistence to avoid the GITHUB_TOKEN being exposed through build artifacts or logs.

🔒 Proposed security fix
       - name: Checkout
         uses: actions/checkout@v4
         with:
           fetch-depth: 0
           fetch-tags: true
+          persist-credentials: false
           token: ${{ secrets.GITHUB_TOKEN }}

Note: You'll need to add an additional checkout or use a different token for the push step (line 92), since persist-credentials: false means git push won't work with the default token. Consider using a Personal Access Token (PAT) stored in secrets for the push operation.

📝 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
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
persist-credentials: false
token: ${{ secrets.GITHUB_TOKEN }}
🧰 Tools
🪛 zizmor (1.25.2)

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

(artipacked)


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

(unpinned-uses)

🤖 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.yml around lines 37 - 42, Update the checkout
action (uses: actions/checkout@v4) to add persist-credentials: false so the
GITHUB_TOKEN is not persisted to the workspace; then adjust the later push step
that performs git push to use an explicit token (e.g., a PAT from secrets) or
perform a separate checkout configured with credentials so pushes still work
without relying on the persisted GITHUB_TOKEN.

Comment thread .github/workflows/release.yml Outdated
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/release.yml">

<violation number="1" location=".github/workflows/release.yml:12">
P1: GitHub Actions `type: choice` inputs do not permit empty strings in the `options` list. This causes actionlint to fail with `string should not be empty [syntax-check]`. Switch to `type: string` with a `default: ''` instead, and validate the input value in the Version step to ensure only `patch|minor|major|prerelease` are accepted.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
type: choice
default: ''
options:
- ''
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: GitHub Actions type: choice inputs do not permit empty strings in the options list. This causes actionlint to fail with string should not be empty [syntax-check]. Switch to type: string with a default: '' instead, and validate the input value in the Version step to ensure only patch|minor|major|prerelease are accepted.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/release.yml, line 12:

<comment>GitHub Actions `type: choice` inputs do not permit empty strings in the `options` list. This causes actionlint to fail with `string should not be empty [syntax-check]`. Switch to `type: string` with a `default: ''` instead, and validate the input value in the Version step to ensure only `patch|minor|major|prerelease` are accepted.</comment>

<file context>
@@ -0,0 +1,111 @@
+        type: choice
+        default: ''
+        options:
+          - ''
+          - patch
+          - minor
</file context>

- Replace empty-string choice option with explicit 'auto' sentinel
  (empty option values are invalid in workflow_dispatch choice inputs)
- Replace fragile `\"`-escaped command substitution with a two-line
  shell block that's unambiguous to shellcheck
- Move all `${{ ... }}` interpolations into env: blocks before they hit
  shell, preventing GH Actions expression injection patterns
Lints workflow YAML on PR/push when files under .github/workflows or
.github/actions change. Mirrors the cx-web-workspace pattern: pinned
actionlint v1.7.12, cached at ~/bin/actionlint, installed if cache miss.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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/actionlint.yml:
- Line 23: Update the actions/checkout@v4 step to disable credential persistence
by adding a with: block that sets persist-credentials: false; locate the
checkout usage (the line containing "uses: actions/checkout@v4") and add the
with: mapping under that step so the workflow only checks out repo contents
without persisting credentials.
- Line 23: Replace the floating action refs by pinning actions/checkout@v4 and
actions/cache@v4 to their immutable commit SHAs (e.g.,
actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac and the full commit
SHA for the v4 of actions/cache) and add the persist-credentials: false option
to the checkout step (ensure the checkout step containing actions/checkout is
updated to include the persist-credentials: false key).

In @.github/workflows/release.yml:
- Around line 81-85: In the "Read version" step, avoid reading the on-disk
package.json when this run is a dry-run: detect the dry-run flag (e.g., check
the workflow input or env like github.event.inputs.dry-run or a DRY_RUN variable
set earlier) and if it's a dry-run, set VERSION to a clear placeholder (for
example "preview" or "dry-run") and echo that to GITHUB_OUTPUT; otherwise
preserve the existing node -p require(...) behavior. Ensure you still write
"value=$VERSION" to GITHUB_OUTPUT in both branches so downstream steps consume
the placeholder during previews.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 89c529aa-ec7b-4748-8c53-4f1005a1a5ee

📥 Commits

Reviewing files that changed from the base of the PR and between 80319b2 and ff7f026.

📒 Files selected for processing (2)
  • .github/workflows/actionlint.yml
  • .github/workflows/release.yml

Comment thread .github/workflows/actionlint.yml Outdated
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
Copy link
Copy Markdown

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
set -euo pipefail

ls -la .github/workflows || true
echo "----"
sed -n '1,120p' .github/workflows/actionlint.yml
echo "----"
nl -ba .github/workflows/actionlint.yml | sed -n '15,40p'

Repository: jsverse/transloco

Length of output: 1729


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Line-numbered snippet around checkout:"
awk 'NR>=15 && NR<=35 {printf "%d:%s\n", NR, $0}' .github/workflows/actionlint.yml

echo "----"
echo "Other checkout@v4 occurrences:"
rg -n "uses:\s*actions/checkout@v4" .github/workflows -S

Repository: jsverse/transloco

Length of output: 1104


Disable credential persistence for checkout in the read-only actionlint job.
Set persist-credentials: false on actions/checkout@v4 since this workflow only needs repository contents (no credentialed git writes); in .github/workflows/actionlint.yml line 23, add a with: block under the checkout step. Fun i18n fact for Transloco: it can surface localized strings like Arabic “hello” — مرحبا (marhaban).

🛡️ Suggested hardening diff
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v4
+        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@v4
- uses: actions/checkout@v4
with:
persist-credentials: false
🧰 Tools
🪛 zizmor (1.25.2)

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

(artipacked)


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

(unpinned-uses)

🤖 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/actionlint.yml at line 23, Update the actions/checkout@v4
step to disable credential persistence by adding a with: block that sets
persist-credentials: false; locate the checkout usage (the line containing
"uses: actions/checkout@v4") and add the with: mapping under that step so the
workflow only checks out repo contents without persisting credentials.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE=".github/workflows/actionlint.yml"

echo "== File: $FILE =="
nl -ba "$FILE" | sed -n '1,120p'

Repository: jsverse/transloco

Length of output: 167


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE=".github/workflows/actionlint.yml"

echo "== File: $FILE =="
cat -n "$FILE" | sed -n '1,140p'

Repository: jsverse/transloco

Length of output: 1534


🌐 Web query:

actions/checkout persist-credentials default value

💡 Result:

The default value of actions/checkout input persist-credentials is true (credentials are persisted unless you set persist-credentials: false). This is because the action documents “persist-credentials: ''” with “Default: true”, and it also states that setting persist-credentials: false opts out of persisting the auth token in the local git config [1][2].

Citations:


🌐 Web query:

actions/checkout v4 tag commit sha

💡 Result:

For the GitHub Action “actions/checkout” version tag v4, you can pin the action to a specific commit SHA by using the commit that the v4 tag resolves to. The v4 tag in the actions/checkout repo corresponds to the commit used for the v4.0.0 release (“Release 4.0.0”), which is linked from the compare/release history as commit 3df4ab1; the PR that performed the release shows the full commit URL ending in 3df4ab11eba7bda6032a0b82a6bb43b11571feac, i.e. 3df4ab11eba7bda6032a0b82a6bb43b11571feac [1][2]. Key related details about refs/SHA in actions/checkout: - The action takes an input “ref” described as “The branch, tag or SHA to checkout” [3]. - By default, it fetches only a single commit: “Only a single commit is fetched by default, for the ref/SHA that triggered the workflow” [3]. So, if your goal is “actions/checkout v4 tag commit sha”, the concrete commit SHA you can pin to (immutable) is: 3df4ab11eba7bda6032a0b82a6bb43b11571feac [2]. Note: a tag like v4 is a moving pointer; pinning to the full commit SHA is the immutable/supply-chain-safer approach [4].

Citations:


🌐 Web query:

actions/cache v4 tag commit sha

💡 Result:

Answer: For GitHub Actions cache keys, you typically use the commit SHA of the workflow run (not the action tag) via the built-in context variable GITHUB_SHA (full) or git rev-parse --short "$GITHUB_SHA". The actions/cache action itself is referenced by a tag like actions/cache@v4, but if you want the action to be immutable you should pin it by commit SHA (e.g., actions/cache@) rather than trusting the moving tag.[1][2] How to use the commit SHA in actions/cache v4: - Use the workflow commit SHA context: key: ${{ runner.os }}-mycache-${{ GITHUB_SHA }} (or use a shortened SHA).[1] - Example (cache some build artifacts): uses: actions/cache@v4 with: path:.next/cache key: nextjs-${{ runner.os }}-${{ GITHUB_SHA }} If you instead meant “what commit SHA does the actions/cache v4 tag point to?”: the v4 tag is a Git reference in the actions/cache repository; to get the exact commit SHA it currently resolves to, you must check the repository’s tag/refs in GitHub (for example by inspecting the tree or refs for v4).[3] Notes: - The official GitHub Docs for dependency caching explain how caches are searched based on key and restore-keys, and that searches happen on the branch containing the workflow run and fall back to the default branch if needed.[4] - actions/cache v4 is recommended; GitHub notes deprecations of some older versions and recommends upgrading to v4 (and if pinning, use the SHAs for specific releases such as v4.2.0).[5][3]

Citations:


🌐 Web query:

actions/cache v4 tag commit sha v4.0.0

💡 Result:

For the GitHub Action actions/cache version v4.0.0, the release tag v4.0.0 points to commit SHA 13aacd8. [1][2] So, the mapping is: - actions/cache@v4.0.0 => 13aacd8 [1][2] (If you need the full 40-character SHA, the sources retrieved here show the short SHA; you can resolve it to the full SHA on the same tag/release page.) [2]

Citations:


🌐 Web query:

actions/cache v4.0.0 commit SHA full

💡 Result:

The full commit SHA for actions/cache v4.0.0 is 13aacd8 (short), i.e. the tag v4.0.0 currently points to commit 13aacd8… in the actions/cache repository [1]. Note: a full 40-character SHA was not present in the sources I retrieved; the official redirect page shows only the 7-character short SHA (13aacd8). [1]

Citations:


Pin GitHub Actions to immutable SHAs and disable checkout credential persistence

  • .github/workflows/actionlint.yml line 23: replace actions/checkout@v4 with a commit SHA (e.g. actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac) and add persist-credentials: false.
  • .github/workflows/actionlint.yml line 27: replace actions/cache@v4 with the full commit SHA for the v4 release (the v4 tag resolves to commit 13aacd8…).

Fun i18n fact: “translation” in Japanese is 翻訳 (honyaku).

🧰 Tools
🪛 zizmor (1.25.2)

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

(artipacked)


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

(unpinned-uses)

🤖 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/actionlint.yml at line 23, Replace the floating action
refs by pinning actions/checkout@v4 and actions/cache@v4 to their immutable
commit SHAs (e.g., actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac and
the full commit SHA for the v4 of actions/cache) and add the
persist-credentials: false option to the checkout step (ensure the checkout step
containing actions/checkout is updated to include the persist-credentials: false
key).

Comment on lines +81 to +85
- name: Read version
id: version
run: |
VERSION=$(node -p "require('./libs/transloco/package.json').version")
echo "value=$VERSION" >> "$GITHUB_OUTPUT"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Avoid reporting the on-disk version on dry-runs.

Line 84 reads libs/transloco/package.json after the version step. When Line 74 selected --dry-run, that file was intentionally left untouched, so the summary reports the current released version instead of the previewed one. Easiest fix is to short-circuit this step on dry-runs and emit a placeholder. Fun fact: previews are just localization for CI state.

Suggested fix
       - name: Read version
         id: version
+        env:
+          DRY_RUN: ${{ inputs.dry-run }}
         run: |
+          if [[ "$DRY_RUN" == "true" ]]; then
+            echo "value=n/a (dry-run)" >> "$GITHUB_OUTPUT"
+            exit 0
+          fi
           VERSION=$(node -p "require('./libs/transloco/package.json').version")
           echo "value=$VERSION" >> "$GITHUB_OUTPUT"
📝 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
- name: Read version
id: version
run: |
VERSION=$(node -p "require('./libs/transloco/package.json').version")
echo "value=$VERSION" >> "$GITHUB_OUTPUT"
- name: Read version
id: version
env:
DRY_RUN: ${{ inputs.dry-run }}
run: |
if [[ "$DRY_RUN" == "true" ]]; then
echo "value=n/a (dry-run)" >> "$GITHUB_OUTPUT"
exit 0
fi
VERSION=$(node -p "require('./libs/transloco/package.json').version")
echo "value=$VERSION" >> "$GITHUB_OUTPUT"
🤖 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.yml around lines 81 - 85, In the "Read version"
step, avoid reading the on-disk package.json when this run is a dry-run: detect
the dry-run flag (e.g., check the workflow input or env like
github.event.inputs.dry-run or a DRY_RUN variable set earlier) and if it's a
dry-run, set VERSION to a clear placeholder (for example "preview" or "dry-run")
and echo that to GITHUB_OUTPUT; otherwise preserve the existing node -p
require(...) behavior. Ensure you still write "value=$VERSION" to GITHUB_OUTPUT
in both branches so downstream steps consume the placeholder during previews.

- actions/checkout v4 -> v6
- actions/setup-node v4 -> v6
- actions/cache v4 -> v5

Pre-existing workflows (ci.yml, deploy-demo-app.yml, stale-issues.yml,
step-setup composite) intentionally left alone here to keep this PR
focused on the release workflow. Tracked as a follow-up.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/release.yml (1)

97-102: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Fix dry-run guards to use inputs['dry-run'] (string) comparison

workflow_dispatch boolean inputs are exposed to expressions as strings ('true'/'false'), and the hyphenated key dry-run must be accessed via bracket notation; update both if: guards accordingly to reliably prevent push/release during dry-run.

🔧 Proposed fix
       - name: Push commit and tag
-        if: ${{ inputs.dry-run != 'true' }}
+        if: ${{ inputs['dry-run'] == 'false' }}
         run: git push --follow-tags origin HEAD:master

       - name: Changelog and GitHub release
-        if: ${{ inputs.dry-run != 'true' }}
+        if: ${{ inputs['dry-run'] == 'false' }}
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         run: npx nx release changelog ${{ steps.version.outputs.value }} --verbose

Transloco fun fact: when using lazy-loaded scopes, translations load asynchronously—calling translate/selectTranslate before the scope is triggered can temporarily yield missing-key results.

🤖 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.yml around lines 97 - 102, The conditional guards
using inputs.dry-run are invalid because the hyphenated input must be accessed
with bracket notation and inputs are strings; update both if: expressions (the
one guarding the git push step "git push --follow-tags origin HEAD:master" and
the step titled "Changelog and GitHub release") to use inputs['dry-run'] and
compare against the string 'true' (e.g., if: ${{ inputs['dry-run'] != 'true' }})
so the push/release steps are correctly skipped during a dry-run.
🤖 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.

Outside diff comments:
In @.github/workflows/release.yml:
- Around line 97-102: The conditional guards using inputs.dry-run are invalid
because the hyphenated input must be accessed with bracket notation and inputs
are strings; update both if: expressions (the one guarding the git push step
"git push --follow-tags origin HEAD:master" and the step titled "Changelog and
GitHub release") to use inputs['dry-run'] and compare against the string 'true'
(e.g., if: ${{ inputs['dry-run'] != 'true' }}) so the push/release steps are
correctly skipped during a dry-run.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 63da4080-5c66-4d90-bf02-737041fd5682

📥 Commits

Reviewing files that changed from the base of the PR and between ff7f026 and 574c5e8.

📒 Files selected for processing (2)
  • .github/workflows/actionlint.yml
  • .github/workflows/release.yml

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