Repository navigation
[optimize] use latest Node.js LTS automatically in the action runtime - #14
Merged
Merged
Conversation
Closed
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
TechQuery
requested changes
Jul 25, 2026
Author
已修改,提交见 |
TechQuery
requested changes
Jul 25, 2026
Author
已修改,提交见 |
TechQuery
approved these changes
Jul 25, 2026
TechQuery
marked this pull request as ready for review
July 25, 2026 08:09
There was a problem hiding this comment.
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.ymlto a composite action and install Node usingactions/setup-nodewithlts/*. - 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 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 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' | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The action was still declaring
node20inruns.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
actions/setup-node@v4withnode-version: lts/*.dist/index.js) to avoid changing action logic.Cross-platform execution
Coverage
lts/*Human changes