Skip to content

[optimize] use latest Node.js LTS automatically in the action runtime - #14

Merged
TechQuery merged 8 commits into
masterfrom
copilot/update-node-lts-version
Jul 25, 2026
Merged

TechQuery merged 8 commits into
masterfrom
copilot/update-node-lts-version

Conversation

Copilot AI commented Jul 25, 2026 •

Copy link
Copy Markdown

The action was still declaring node20 in runs.using, which now produces deprecation warnings on GitHub-hosted runners. This change makes the action follow the current Node.js LTS line without requiring manual version bumps.

  • Runtime model

    • Convert the action from a pinned JavaScript runtime declaration to a composite action.
    • Install Node via actions/setup-node@v4 with node-version: lts/*.
    • Continue executing the existing bundled entrypoint (dist/index.js) to avoid changing action logic.
  • Cross-platform execution

    • Keep execution shell selection explicit so the bundled script runs consistently on Windows and non-Windows runners.
  • Coverage

    • Replace the placeholder test with a focused metadata assertion that verifies:
      • the action uses a composite wrapper
      • Node is resolved from lts/*
      • the bundled script remains the execution target
runs:
  using: 'composite'
  steps:
    - uses: actions/setup-node@v4
      with:
        node-version: 'lts/*'
    - shell: ${{ runner.os == 'Windows' && 'pwsh' || ((runner.os == 'Linux' || runner.os == 'macOS') && 'bash') }}
      run: node dist/index.js

Human changes

  1. [optimize] update Lark-GitHub-action & other Upstream actions

Copilot AI linked an issue Jul 25, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Update action config to use Node.js LTS version Track Node.js LTS in the action runtime Jul 25, 2026
Copilot AI requested a review from TechQuery July 25, 2026 07:51

@TechQuery TechQuery left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@copilot 请修改

Comment thread action.yml Resolved
Comment thread __tests__/main.test.ts Resolved
@TechQuery TechQuery added the bug Something isn't working label Jul 25, 2026

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Author

@copilot 请修改

已修改,提交见 06d1c18。

Copilot AI requested a review from TechQuery July 25, 2026 07:57

@TechQuery TechQuery left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@copilot

"@types/node": "^20.17.9",
的版本也至少升级到 ^24.13.3。

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Author

@copilot

"@types/node": "^20.17.9",
的版本也至少升级到 ^24.13.3。

已修改,提交见 4f37b48。

Copilot AI requested a review from TechQuery July 25, 2026 08:01
@TechQuery
TechQuery marked this pull request as ready for review July 25, 2026 08:09

Copilot AI 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.

Pull request overview

This PR updates the GitHub Action runtime to track the current Node.js LTS line automatically by switching from a runs.using: node20 JavaScript action to a composite wrapper that installs Node via actions/setup-node with node-version: lts/*, while continuing to execute the existing bundled dist/index.js entrypoint.

Changes:

  • Convert action.yml to a composite action and install Node using actions/setup-node with lts/*.
  • Update CI workflow dependencies (e.g., actions/checkout) and refactor the Lark notification workflow’s message serialization plumbing.
  • Replace the placeholder test with assertions that validate the action metadata structure (composite + setup-node + bundled entrypoint).

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
yarn.lock Updates lockfile to reflect new @types/node / undici-types resolution.
package.json Bumps @types/node to a newer major line.
action.yml Switches the action to a composite wrapper that installs Node from lts/* and runs dist/index.js.
.github/workflows/test.yml Updates workflow dependencies (e.g., checkout major) while keeping the build/test intent.
.github/workflows/Lark-notification.yml Simplifies passing GitHub context JSON into the Deno transformer via an env var and printf.
.github/scripts/transform-message.ts Refactors some formatting/typing in the Lark message transformer.
__tests__/main.test.ts Replaces placeholder test with metadata assertions for the composite wrapper and Node LTS usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread action.yml
Comment on lines +32 to +38
- shell: ${{ runner.os == 'Windows' && 'pwsh' || ((runner.os == 'Linux' || runner.os == 'macOS') && 'bash') }}
working-directory: ${{ github.action_path }}
env:
INPUT_URL: ${{ inputs.url }}
INPUT_MSG_TYPE: ${{ inputs.msg_type }}
INPUT_CONTENT: ${{ inputs.content }}
run: node dist/index.js
Comment thread __tests__/main.test.ts
Comment on lines +23 to +34
expect(action.runs.using).toBe('composite')
expect(action.runs.steps[0]).toMatchObject({
uses: 'actions/setup-node@v7',
with: {
'node-version': 'lts/*'
}
})
expect(action.runs.steps[1]).toMatchObject({
shell:
"${{ runner.os == 'Windows' && 'pwsh' || ((runner.os == 'Linux' || runner.os == 'macOS') && 'bash') }}",
run: 'node dist/index.js'
})
Comment thread action.yml Resolved
@TechQuery TechQuery changed the title Track Node.js LTS in the action runtime [optimize] use latest Node.js LTS automatically in the action runtime Jul 25, 2026
@TechQuery
TechQuery merged commit 51744d5 into master Jul 25, 2026
5 checks passed
@TechQuery
TechQuery deleted the copilot/update-node-lts-version branch July 25, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

自适应 Node.js LTS 版本

3 participants