Skip to content

Update publishing to use OIDC - #158

Merged
stwiname merged 1 commit into
mainfrom
npm-oidc-near
Dec 2, 2025
Merged

Update publishing to use OIDC#158
stwiname merged 1 commit into
mainfrom
npm-oidc-near

Conversation

@stwiname

@stwiname stwiname commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

Release Notes

  • Chores
    • Upgraded build tooling and package manager for improved performance and reliability
    • Streamlined and consolidated release automation workflows to optimize publishing efficiency
    • Updated CI/CD infrastructure and action versions for enhanced stability and security
    • Refactored release process to ensure consistent multi-package deployments

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 2, 2025

Copy link
Copy Markdown

Walkthrough

The PR updates GitHub Actions versions (checkout and setup-node to v5), removes npm-token inputs from two action definitions, consolidates separate release and prerelease workflows into a unified publish workflow, and upgrades Yarn from 3.1.1 to 4.12.0 with corresponding configuration changes.

Changes

Cohort / File(s) Summary
GitHub Actions Version Upgrades
\.github/workflows/benchmark.yml, \.github/workflows/gh-release.yml, \.github/workflows/node-docker.yml, \.github/workflows/pr.yml, \.github/workflows/sync-deps.yml
Updated checkout action from v4 to v5 and setup-node from v4 to v5 (or v3 to v5 for sync-deps). No changes to control flow or step logic.
Discord Webhook Action Update
\.github/workflows/discord.yml
Upgraded rjstone/discord-webhook-notify action from v1 to v2 in the "Send release details to Discord" step.
npm-token Input Removal
\.github/actions/create-prerelease/action.yml, \.github/actions/create-release/action.yml
Removed npm-token input declarations and eliminated corresponding NPM_TOKEN environment variable references in publish steps.
Workflow Consolidation
\.github/workflows/prerelease.yml (removed), \.github/workflows/release.yml (removed), \.github/workflows/publish.yml (added)
Removed separate prerelease and release workflows; introduced unified publish.yml workflow that consolidates both release and prerelease publishing logic with commit message detection, path-change detection, and conditional per-package publishing via create-release and create-prerelease actions.
Yarn Version Upgrade
\.yarnrc.yml, package.json
Updated Yarn from 3.1.1 to 4.12.0; removed old plugins block; added nodeLinker, compressionLevel, and enableGlobalCache configuration fields; updated yarnPath in action.yml.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Areas requiring extra attention:

  • Verify the new \.github/workflows/publish.yml consolidates all functionality from the removed release and prerelease workflows, ensuring no automation gaps.
  • Confirm the pre-commit hook for [release] and [SKIP CI] commit message handling works as intended in the unified workflow.
  • Validate Yarn 4.12.0 configuration changes in \.yarnrc.yml (new fields: changesetIgnorePatterns, compressionLevel, enableGlobalCache, nodeLinker) are compatible with existing toolchain.
  • Ensure removal of npm-token from actions does not break publishing steps without token authentication.

Poem

🐰 Workflows consolidated, actions refined,
Old tokens removed from the automated mind.
Yarn now sprints at version four,
GitHub Actions leap to v5's door.
Publish unified—the release flows divine! 🚀

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Update publishing to use OIDC' is vague and generic, providing minimal clarity about the actual changes made to the codebase. Consider a more descriptive title that specifies the scope of changes, such as 'Migrate npm publishing to OIDC authentication' or 'Replace npm-token with OIDC in publishing workflows'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch npm-oidc-near

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

@github-actions

github-actions Bot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

Coverage report

Caution

Test run failed

St.
Category Percentage Covered / Total
🔴 Statements 29.69% 854/2876
🔴 Branches 35.42% 17/48
🔴 Functions 9.15% 13/142
🔴 Lines 29.69% 854/2876

Test suite run failed

Failed tests: 9/11. Failed suites: 3/3.
  ● dictionary v1 › successfully validates metatada

    ApolloError: Only absolute URLs are supported

      at new ApolloError (node_modules/@apollo/client/errors/index.js:40:28)
      at node_modules/@apollo/client/core/QueryManager.js:785:71
      at both (node_modules/@apollo/client/utilities/observables/asyncMap.js:22:31)
      at node_modules/@apollo/client/utilities/observables/asyncMap.js:11:72
      at Object.then (node_modules/@apollo/client/utilities/observables/asyncMap.js:11:24)
      at Object.error (node_modules/@apollo/client/utilities/observables/asyncMap.js:24:49)
      at notifySubscription (node_modules/zen-observable/lib/Observable.js:140:18)
      at onNotify (node_modules/zen-observable/lib/Observable.js:179:3)
      at SubscriptionObserver.error (node_modules/zen-observable/lib/Observable.js:240:7)
      at node_modules/@apollo/client/utilities/observables/iteration.js:7:68
          at Array.forEach (<anonymous>)
      at iterateObserversSafely (node_modules/@apollo/client/utilities/observables/iteration.js:7:25)
      at Object.error (node_modules/@apollo/client/utilities/observables/Concast.js:76:21)
      at notifySubscription (node_modules/zen-observable/lib/Observable.js:140:18)
      at onNotify (node_modules/zen-observable/lib/Observable.js:179:3)
      at SubscriptionObserver.error (node_modules/zen-observable/lib/Observable.js:240:7)
      at handleError (node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js:170:14)
      at node_modules/@apollo/client/link/http/createHttpLink.js:145:17

    Cause:
    TypeError: Only absolute URLs are supported

      238 |       chainId,
      239 |     );
    > 240 |     await dictionary.init();
          |                      ^
      241 |     return dictionary;
      242 |   }
      243 |

      at getNodeRequestOptions (node_modules/node-fetch/lib/index.js:1327:9)
      at node_modules/node-fetch/lib/index.js:1440:19
      at fetch (node_modules/node-fetch/lib/index.js:1437:9)
      at fetch (node_modules/cross-fetch/dist/node-ponyfill.js:10:20)
      at node_modules/@apollo/client/link/http/createHttpLink.js:127:13
      at new Subscription (node_modules/zen-observable/lib/Observable.js:197:34)
      at Observable.subscribe (node_modules/zen-observable/lib/Observable.js:279:14)
      at Object.complete (node_modules/@apollo/client/utilities/observables/Concast.js:111:43)
      at Concast.Object.<anonymous>.Concast.start (node_modules/@apollo/client/utilities/observables/Concast.js:152:23)
      at new Concast (node_modules/@apollo/client/utilities/observables/Concast.js:137:19)
      at QueryManager.Object.<anonymous>.QueryManager.getObservableFromLink (node_modules/@apollo/client/core/QueryManager.js:711:35)
      at QueryManager.Object.<anonymous>.QueryManager.getResultsFromLink (node_modules/@apollo/client/core/QueryManager.js:748:30)
      at resultsFromLink (node_modules/@apollo/client/core/QueryManager.js:1049:26)
      at QueryManager.Object.<anonymous>.QueryManager.fetchQueryByPolicy (node_modules/@apollo/client/core/QueryManager.js:1112:52)
      at fromVariables (node_modules/@apollo/client/core/QueryManager.js:819:41)
      at QueryManager.Object.<anonymous>.QueryManager.fetchConcastWithInfo (node_modules/@apollo/client/core/QueryManager.js:861:35)
      at QueryManager.Object.<anonymous>.QueryManager.fetchQuery (node_modules/@apollo/client/core/QueryManager.js:374:21)
      at QueryManager.Object.<anonymous>.QueryManager.query (node_modules/@apollo/client/core/QueryManager.js:468:21)
      at ApolloClient.Object.<anonymous>.ApolloClient.query (node_modules/@apollo/client/core/ApolloClient.js:233:34)
      at NearDictionaryV1.init (node_modules/@subql/node-core/src/indexer/dictionary/v1/dictionaryV1.ts:57:21)
      at NearDictionaryV1.create (packages/node/src/indexer/dictionary/v1/nearDictionaryV1.ts:240:22)
      at Object.<anonymous> (packages/node/src/indexer/dictionary/v1/nearDictionaryV1.spec.ts:45:41)


  ● BlockchainService › can get a block timestamps

    Request validation error

      at BackOff.request (node_modules/@near-js/providers/lib/commonjs/fetch_json.cjs:69:13)


  ● Near api › Receipt Filters › Can filter receipts with sender, receiver and signer

    {"jsonrpc":"2.0","id":123,"error":{"code":-32000,"message":"Server error","data":"DB Not Found Error: BLOCK HEIGHT: 85686945 \n Cause: Unknown","name":"HANDLER_ERROR","cause":{"info":{},"name":"UNKNOWN_BLOCK"}}}

      at BackOff.request (node_modules/@near-js/providers/lib/commonjs/fetch_json.cjs:74:13)

  ● Near api › Receipt Filters › Can filter receipts with sender, receiver and signer - filter does not match

    {"jsonrpc":"2.0","id":123,"error":{"code":-32000,"message":"Server error","data":"DB Not Found Error: BLOCK HEIGHT: 85686945 \n Cause: Unknown","name":"HANDLER_ERROR","cause":{"info":{},"name":"UNKNOWN_BLOCK"}}}

      at BackOff.request (node_modules/@near-js/providers/lib/commonjs/fetch_json.cjs:74:13)

  ● Near api › Action Filters › Can filter FunctionCall actions

    {"jsonrpc":"2.0","id":126,"error":{"code":-32000,"message":"Server error","data":"DB Not Found Error: BLOCK HEIGHT: 85686945 \n Cause: Unknown","name":"HANDLER_ERROR","cause":{"info":{},"name":"UNKNOWN_BLOCK"}}}

      at BackOff.request (node_modules/@near-js/providers/lib/commonjs/fetch_json.cjs:74:13)

  ● Near api › Action Filters › Can filter Stake actions

    {"jsonrpc":"2.0","id":126,"error":{"code":-32000,"message":"Server error","data":"DB Not Found Error: BLOCK HEIGHT: 85686945 \n Cause: Unknown","name":"HANDLER_ERROR","cause":{"info":{},"name":"UNKNOWN_BLOCK"}}}

      at BackOff.request (node_modules/@near-js/providers/lib/commonjs/fetch_json.cjs:74:13)

  ● Near api › Action Filters › Can filter AddKey actions

    {"jsonrpc":"2.0","id":126,"error":{"code":-32000,"message":"Server error","data":"DB Not Found Error: BLOCK HEIGHT: 85686945 \n Cause: Unknown","name":"HANDLER_ERROR","cause":{"info":{},"name":"UNKNOWN_BLOCK"}}}

      at BackOff.request (node_modules/@near-js/providers/lib/commonjs/fetch_json.cjs:74:13)

  ● Near api › Action Filters › Can filter DeleteKey actions

    {"jsonrpc":"2.0","id":126,"error":{"code":-32000,"message":"Server error","data":"DB Not Found Error: BLOCK HEIGHT: 85686945 \n Cause: Unknown","name":"HANDLER_ERROR","cause":{"info":{},"name":"UNKNOWN_BLOCK"}}}

      at BackOff.request (node_modules/@near-js/providers/lib/commonjs/fetch_json.cjs:74:13)

  ● Near api › Action Filters › Can filter actions with receipt filters

    {"jsonrpc":"2.0","id":126,"error":{"code":-32000,"message":"Server error","data":"DB Not Found Error: BLOCK HEIGHT: 85686945 \n Cause: Unknown","name":"HANDLER_ERROR","cause":{"info":{},"name":"UNKNOWN_BLOCK"}}}

      at BackOff.request (node_modules/@near-js/providers/lib/commonjs/fetch_json.cjs:74:13)

  ● Near api › Action Filters › Can filter DeleteAccount actions

    {"jsonrpc":"2.0","id":126,"error":{"code":-32000,"message":"Server error","data":"DB Not Found Error: BLOCK HEIGHT: 85686945 \n Cause: Unknown","name":"HANDLER_ERROR","cause":{"info":{},"name":"UNKNOWN_BLOCK"}}}

      at BackOff.request (node_modules/@near-js/providers/lib/commonjs/fetch_json.cjs:74:13)

  ● Near api › Action Filters › Can filter SignedDelegate actions

    {"jsonrpc":"2.0","id":126,"error":{"code":-32000,"message":"Server error","data":"DB Not Found Error: BLOCK HEIGHT: 85686945 \n Cause: Unknown","name":"HANDLER_ERROR","cause":{"info":{},"name":"UNKNOWN_BLOCK"}}}

      at BackOff.request (node_modules/@near-js/providers/lib/commonjs/fetch_json.cjs:74:13)

Report generated by 🧪jest coverage report action from d1d2dfa

@stwiname
stwiname merged commit 804d6f3 into main Dec 2, 2025
2 of 4 checks passed

@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: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aa809da and d1d2dfa.

⛔ Files ignored due to path filters (7)
  • .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs is excluded by !**/.yarn/**
  • .yarn/plugins/@yarnpkg/plugin-typescript.cjs is excluded by !**/.yarn/**
  • .yarn/plugins/@yarnpkg/plugin-version.cjs is excluded by !**/.yarn/**
  • .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs is excluded by !**/.yarn/**
  • .yarn/releases/yarn-3.1.1.cjs is excluded by !**/.yarn/**
  • .yarn/releases/yarn-4.12.0.cjs is excluded by !**/.yarn/**
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (13)
  • .github/actions/create-prerelease/action.yml (2 hunks)
  • .github/actions/create-release/action.yml (0 hunks)
  • .github/workflows/benchmark.yml (1 hunks)
  • .github/workflows/discord.yml (1 hunks)
  • .github/workflows/gh-release.yml (1 hunks)
  • .github/workflows/node-docker.yml (3 hunks)
  • .github/workflows/pr.yml (2 hunks)
  • .github/workflows/prerelease.yml (0 hunks)
  • .github/workflows/publish.yml (1 hunks)
  • .github/workflows/release.yml (0 hunks)
  • .github/workflows/sync-deps.yml (1 hunks)
  • .yarnrc.yml (2 hunks)
  • package.json (1 hunks)
💤 Files with no reviewable changes (3)
  • .github/actions/create-release/action.yml
  • .github/workflows/release.yml
  • .github/workflows/prerelease.yml
🧰 Additional context used
🪛 actionlint (1.7.9)
.github/workflows/publish.yml

31-31: "github.event.head_commit.message" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details

(expression)

🔇 Additional comments (12)
.github/workflows/benchmark.yml (2)

76-76: LGTM!

Formatting cleanup (trailing whitespace removal) is benign and improves consistency.


68-68: actions/checkout@v5 is stable and recommended. The upgrade to actions/checkout@v5 is a benign change to the current stable release, which uses the Node 24 runtime and is compatible with GitHub Actions runner v2.327.1 or later. No compatibility issues with the fetch-depth: 100 parameter are known.

.github/workflows/pr.yml (1)

15-17: GitHub Actions versions confirmed as stable.

Both actions/checkout@v5 and actions/setup-node@v5 are official stable releases and appropriate for this workflow's needs (linting, building, testing with Jest). No action required.

.github/workflows/node-docker.yml (1)

19-19: actions/checkout@v5 is available and compatible. The upgrade is stable and maintains full backward compatibility with fetch-depth settings (default behavior unchanged, supporting values like 2, 100, and 0). Requires GitHub Actions runner v2.327.1 or newer; no breaking changes across the three jobs.

.github/workflows/sync-deps.yml (1)

18-20: Verify GitHub Actions runner compatibility and automatic caching behavior.

Both actions/checkout@v5 and actions/setup-node@v5 are stable releases (v5.0.0). However, both require GitHub Actions Runner v2.327.1 or later due to their Node 24 runtime upgrade—ensure self-hosted runners are updated if applicable.

Additionally, actions/setup-node@v5 enables automatic package-manager-aware caching by default. Since this workflow uses yarn, dependency caching will now happen automatically; verify this aligns with your caching strategy. Note that v5.1+ includes architecture in the cache key format, which may cause cache invalidation when upgrading within the v5 series.

.github/workflows/gh-release.yml (1)

11-16: GitHub Actions versions are stable and current; custom release actions appear compatible.

Both actions/checkout@v5 and actions/setup-node@v5 are published, stable releases. The custom actions (.github/actions/create-release and .github/actions/create-prerelease) use standard composite action patterns with token inputs and present no obvious compatibility issues with the upgraded action versions.

.github/workflows/discord.yml (1)

14-14: No action needed—discord-webhook-notify@v2 maintains backward compatibility with v1 and is the recommended version per the official marketplace documentation.

.yarnrc.yml (1)

5-6: Yarn 4.12.0 configuration verified and correct.

All settings in .yarnrc.yml are properly configured for Yarn 4.x:

  • nodeLinker: node-modules (line 16): Valid Yarn 4.x configuration that switches from PnP to classic node_modules layout. Confirmed file .yarn/releases/yarn-4.12.0.cjs exists.
  • enableGlobalCache: false (line 10): Intentional CI configuration to disable global cache.
  • compressionLevel: mixed (line 8): Valid Yarn 4.x compression setting.
  • yarnPath (line 22): Correctly points to existing release file.

No issues detected. All settings align with Yarn 4.x requirements and are appropriate for monorepo configuration.

.github/workflows/publish.yml (4)

77-80: Verify release job condition for null-safe access of commit message.

Line 78 accesses github.event.head_commit.message directly in the job condition without null-checking. The fallback to git log in the pre-ci job ensures output, but the condition here may fail if the head_commit is null. Ensure this condition is robust for all trigger scenarios (e.g., webhook payloads that lack head_commit).


131-135: Clarify OIDC + explicit token checkout pattern in prerelease job.

The prerelease job checks out with token: ${{ secrets.REPO_TOKEN }} (line 134) to enable pushing changes back to the repo. However, the workflow declares id-token: write permission for OIDC. Verify that:

  1. REPO_TOKEN is necessary for git push (OIDC may not provide write access to contents by default), or
  2. OIDC is fully replacing token-based authentication and REPO_TOKEN can be removed.

This clarification helps ensure the transition to OIDC is complete and REPO_TOKEN is not a legacy holdover.


169-173: Verify EndBug/add-and-commit@v9 is compatible with OIDC credentials.

The prerelease job uses the EndBug/add-and-commit@v9 action to commit and push changes. Confirm that this action respects the REPO_TOKEN secret or automatically uses the checked-out credentials (from line 134) for authentication. If the action does not support OIDC tokens, consider using native git commands with the environment token instead.


101-120: OIDC for npm is correctly configured; REPO_TOKEN is properly scoped to GitHub releases.

The workflow already uses OIDC for npm publishing: setup-node@v5 with permissions.id-token: write automatically configures npm registry authentication via OIDC. The REPO_TOKEN is correctly scoped only to GitHub API calls in gh-release-script.js for creating releases, as documented in the action input description. No changes needed.

Comment on lines 18 to +19
- working-directory: ${{ inputs.package-path }}
run: echo "Changes exist in ${{ inputs.package-path }}" && yarn version prerelease && yarn npm publish --access public --tag dev
env:
NPM_TOKEN: ${{ inputs.npm-token }}
run: echo "Changes exist in ${{ inputs.package-path }}" && yarn version prerelease && yarn npm publish --access public --tag dev

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 | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

find . -name '.yarnrc.yml' -o -name '.yarnrc' | head -10 | xargs -I {} sh -c 'echo "=== {} ===" && cat "{}"'

Repository: subquery/subql-near

Length of output: 429


🏁 Script executed:

cat -n .github/actions/create-prerelease/action.yml

Repository: subquery/subql-near

Length of output: 983


🏁 Script executed:

find . -path './.git' -prune -o -name '*.yml' -o -name '*.yaml' | grep -E '(\.github/workflows|\.github/actions)' | head -20

Repository: subquery/subql-near

Length of output: 383


🏁 Script executed:

grep -r "create-prerelease" .github/workflows/ 2>/dev/null | head -20

Repository: subquery/subql-near

Length of output: 302


🏁 Script executed:

cat -n .github/workflows/publish.yml

Repository: subquery/subql-near

Length of output: 6082


Configure NPM_TOKEN environment variable in the publish step.

The publish step relies on .yarnrc.yml's npmAuthToken: "${NPM_TOKEN:-}" configuration, but the action does not set the NPM_TOKEN environment variable. While the workflow has id-token: write permission for OIDC, the action itself is not configured to use it. Either pass NPM_TOKEN as a secret from the calling workflow or configure the action to exchange the OIDC token for npm authentication.

🤖 Prompt for AI Agents
In .github/actions/create-prerelease/action.yml around lines 18-19, the publish
run uses .yarnrc.yml npmAuthToken but does not provide NPM_TOKEN; update the
action to set the NPM_TOKEN environment variable before running yarn (either
accept it as an input and map it from the caller's secrets, or implement OIDC
exchange logic to retrieve an npm auth token and export it as NPM_TOKEN), then
run the existing prerelease and publish commands so yarn can read npmAuthToken
from the environment.

Comment on lines +31 to +40
run: |
COMMIT_MSG_TEMP="${{ github.event.head_commit.message }}"
if [ -n "$COMMIT_MSG_TEMP" ]
then
commit_msg="$COMMIT_MSG_TEMP"
echo "commit-message=${commit_msg}" | head -n 1 >> "$GITHUB_OUTPUT"
else
commit_message=$(git log -1 --pretty=%B | head -n 1)
echo "commit-message=$commit_message" >> "$GITHUB_OUTPUT"
fi

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 | 🔴 Critical

Fix script injection vulnerability by passing context through environment variable.

Line 31 directly interpolates ${{ github.event.head_commit.message }} into a bash command, which is vulnerable to script injection if the commit message contains shell metacharacters.

Apply this diff to safely pass the context value through an environment variable:

      - id: get_commit_message
+       env:
+         COMMIT_MSG_TEMP: ${{ github.event.head_commit.message }}
        run: |
-         COMMIT_MSG_TEMP="${{ github.event.head_commit.message }}"
          if [ -n "$COMMIT_MSG_TEMP" ]
          then
            commit_msg="$COMMIT_MSG_TEMP"
            echo "commit-message=${commit_msg}" | head -n 1 >> "$GITHUB_OUTPUT"
          else
            commit_message=$(git log -1 --pretty=%B | head -n 1)
            echo "commit-message=$commit_message" >> "$GITHUB_OUTPUT"
          fi
📝 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
run: |
COMMIT_MSG_TEMP="${{ github.event.head_commit.message }}"
if [ -n "$COMMIT_MSG_TEMP" ]
then
commit_msg="$COMMIT_MSG_TEMP"
echo "commit-message=${commit_msg}" | head -n 1 >> "$GITHUB_OUTPUT"
else
commit_message=$(git log -1 --pretty=%B | head -n 1)
echo "commit-message=$commit_message" >> "$GITHUB_OUTPUT"
fi
- id: get_commit_message
env:
COMMIT_MSG_TEMP: ${{ github.event.head_commit.message }}
run: |
if [ -n "$COMMIT_MSG_TEMP" ]
then
commit_msg="$COMMIT_MSG_TEMP"
echo "commit-message=${commit_msg}" | head -n 1 >> "$GITHUB_OUTPUT"
else
commit_message=$(git log -1 --pretty=%B | head -n 1)
echo "commit-message=$commit_message" >> "$GITHUB_OUTPUT"
fi
🧰 Tools
🪛 actionlint (1.7.9)

31-31: "github.event.head_commit.message" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details

(expression)

🤖 Prompt for AI Agents
.github/workflows/publish.yml around lines 31 to 40: the workflow currently
interpolates ${{ github.event.head_commit.message }} directly into a shell
script which can allow script injection; instead add an environment variable in
the step (e.g., COMMIT_MSG_RAW: "${{ github.event.head_commit.message }}") and
change the script to read from that env var (COMMIT_MSG_TEMP="$COMMIT_MSG_RAW")
so no GitHub expression is expanded inside the shell; ensure you still test for
non-empty safely (use [ -n "$COMMIT_MSG_TEMP" ]) and keep all variable values
quoted when echoing to GITHUB_OUTPUT to preserve content and prevent
word-splitting or unintended execution.

Comment thread package.json
]
},
"packageManager": "yarn@3.1.1"
"packageManager": "yarn@4.12.0"

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

🧩 Analysis chain

🌐 Web query:

Yarn 4.12.0 release stable breaking changes from Yarn 3.x to 4.x

💡 Result:

Short summary — what changed when upgrading from Yarn 3.x → Yarn 4.x (and note about 4.12.0)

Key breaking / behavior changes to watch for:

  • Node requirement: Yarn 4 requires Node.js 18+ (3.x supported older Node versions). [1][2]
  • Installation / versioning: new projects and tooling favor Corepack / packageManager over yarnPath; yarn init / yarn set version behavior changed. If you must run on older Node, avoid yarn set version or pin a 3.x yarnPath. [1][2][4]
  • Zero‑Install / cache defaults: new projects created with yarn init no longer enable Zero‑Install by default; enableGlobalCache defaults flipped (Zero‑Install projects may have .yarnrc.yml updated on first install). [1][2]
  • Official plugins: many official plugins (TypeScript, interactive tools, etc.) are bundled/enabled by default. [1]
  • CLI changes: small command syntax changes (notably yarn workspaces foreach syntax). Also some flags/option renames and hardened-mode additions that tighten lockfile/resolve checks. [1][2]
  • Config files: same modern config file style (.yarnrc.yml) and some config keys/defaults changed — review your .yarnrc.yml after migration. [2][6]
  • Migration friction: the maintainers attempted to avoid surprising breaking changes and many migrations are automatic, but some CI/installation flows (especially on older Node) require manual adjustments. [1][7]

About 4.12.0 specifically:

  • v4.12.0 (released Nov 23, 2025) is a patch release with bug fixes (git clone arg fix, npm web login support, JSON schema fix) — it does not introduce new 4.x breaking changes beyond the 4.0 migration items above. [3]

If you want, I can:

  • produce a checklist of exact changes to apply to a repo (package.json, .yarnrc.yml, CI), or
  • scan your repo for likely incompatible settings and give concrete edits.

Sources:
[1] Yarn blog — Release: Yarn 4.0 (breaking changes & migration notes).
[2] Yarn changelog (4.0 / related entries).
[3] GitHub — yarnpkg/berry release v4.12.0.
[4] GitHub issue: yarn set version on Node <18 (migration/compat note).
[6] Yarn migration guide / step-by-step.
[7] GitHub discussions about 4.0 migration clarity.


Verify Yarn 4.12.0 is stable and that lock file is regenerated.

This is a major version bump from Yarn 3.1.1 to 4.12.0 with several breaking changes. Ensure the yarn.lock file has been regenerated with the new version, confirm Node.js 18+ compatibility (Yarn 4 requires Node 18+), review any changes to .yarnrc.yml configuration, and validate that all test workflows pass with the upgraded package manager.

🤖 Prompt for AI Agents
In package.json around line 56, the packageManager was changed to "yarn@4.12.0";
confirm Yarn 4.12.0 is intentionally chosen, ensure the repo is using Node.js
18+ (update engine fields or CI runners if needed), regenerate yarn.lock with
Yarn v4.12.0 (delete existing lock, run yarn install with that Yarn binary) and
commit the updated yarn.lock, review and update .yarnrc.yml for any breaking
config changes introduced by Yarn 4, and run the full test/CI workflows locally
or in CI to validate no regressions.

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