feat: update runtime to node 24

This commit is contained in:
Peter Evans
2025-11-14 16:18:41 +00:00
parent 9dbeb595ee
commit f3e5a0553e
12 changed files with 267 additions and 603 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: 20.x
node-version-file: package.json
cache: npm
- run: npm ci
- run: npm run build
+1 -1
View File
@@ -11,7 +11,7 @@ on:
type: choice
description: The major version tag to update
options:
- v4
- v5
jobs:
tag:
+5 -5
View File
@@ -54,7 +54,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v4
uses: peter-evans/slash-command-dispatch@v5
with:
token: ${{ secrets.PAT }}
commands: |
@@ -102,7 +102,7 @@ You can use a [PAT](https://docs.github.com/en/github/authenticating-to-github/c
```yml
- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v4
uses: peter-evans/slash-command-dispatch@v5
with:
token: ${{ secrets.PAT }}
reaction-token: ${{ secrets.PAT }}
@@ -178,7 +178,7 @@ It will also contain any static arguments if configured.
To demonstrate, take the following configuration as an example.
```yml
- uses: peter-evans/slash-command-dispatch@v4
- uses: peter-evans/slash-command-dispatch@v5
with:
token: ${{ secrets.PAT }}
commands: |
@@ -248,7 +248,7 @@ The simplest response is to add a :tada: reaction to the comment.
```yml
- name: Add reaction
uses: peter-evans/create-or-update-comment@v4
uses: peter-evans/create-or-update-comment@v5
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
@@ -264,7 +264,7 @@ Another option is to reply with a new comment containing a link to the run outpu
run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_OUTPUT
- name: Create comment
uses: peter-evans/create-or-update-comment@v4
uses: peter-evans/create-or-update-comment@v5
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
+1 -1
View File
@@ -41,7 +41,7 @@ outputs:
error-message:
description: 'Validation errors when using `workflow` dispatch.'
runs:
using: 'node20'
using: 'node24'
main: 'dist/index.js'
branding:
icon: 'target'
+5 -4
View File
@@ -384,8 +384,8 @@ class GitHubHelper {
if (count == 10)
break;
}
yield this.octokit.request('POST /repos/{owner}/{repo}/actions/workflows/{workflow}/dispatches', Object.assign(Object.assign({}, this.parseRepository(cmd.repository)), { workflow: workflow, ref: ref, inputs: inputs }));
core.info(`Command '${cmd.command}' dispatched to workflow '${workflowName}' in '${cmd.repository}'`);
yield this.octokit.request('POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches', Object.assign(Object.assign({}, this.parseRepository(cmd.repository)), { workflow_id: workflow, ref: ref, inputs: inputs }));
core.info(`Command '${cmd.command}' dispatched to workflow '${workflow}' in '${cmd.repository}'`);
});
}
getWorkflow(repository, workflowName) {
@@ -393,8 +393,9 @@ class GitHubHelper {
core.debug(`Getting workflow ${workflowName} for repository ${repository}`);
const { data: workflows } = yield this.octokit.rest.actions.listRepoWorkflows(Object.assign({}, this.parseRepository(repository)));
for (const workflow of workflows.workflows) {
if (workflow.path === `${workflowName}.yml` || workflow.path === `${workflowName}.yaml`) {
core.info(`Selecting workflow file ${workflow.path}`);
if (workflow.path === `${workflowName}.yml` ||
workflow.path === `${workflowName}.yaml`) {
core.debug(`Selecting workflow file ${workflow.path}`);
return workflow.path;
}
}
+3 -3
View File
@@ -8,7 +8,7 @@ For example, the following basic configuration means that all commands must have
```yml
- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v4
uses: peter-evans/slash-command-dispatch@v5
with:
token: ${{ secrets.PAT }}
commands: |
@@ -38,7 +38,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v4
uses: peter-evans/slash-command-dispatch@v5
with:
token: ${{ secrets.PAT }}
config: >
@@ -84,7 +84,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v4
uses: peter-evans/slash-command-dispatch@v5
with:
token: ${{ secrets.PAT }}
config-from-file: .github/slash-command-dispatch.json
+7 -7
View File
@@ -50,7 +50,7 @@ jobs:
# Add reaction to the comment
- name: Add reaction
uses: peter-evans/create-or-update-comment@v4
uses: peter-evans/create-or-update-comment@v5
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
@@ -111,7 +111,7 @@ jobs:
# Add reaction to the comment
- name: Add reaction
uses: peter-evans/create-or-update-comment@v4
uses: peter-evans/create-or-update-comment@v5
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
@@ -158,7 +158,7 @@ jobs:
git push
- name: Add reaction
uses: peter-evans/create-or-update-comment@v4
uses: peter-evans/create-or-update-comment@v5
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
@@ -204,7 +204,7 @@ jobs:
git push --force-with-lease
- name: Update comment
uses: peter-evans/create-or-update-comment@v4
uses: peter-evans/create-or-update-comment@v5
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
@@ -218,7 +218,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Update comment
uses: peter-evans/create-or-update-comment@v4
uses: peter-evans/create-or-update-comment@v5
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
@@ -279,7 +279,7 @@ jobs:
git push
- name: Add reaction
uses: peter-evans/create-or-update-comment@v4
uses: peter-evans/create-or-update-comment@v5
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
@@ -301,7 +301,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Update comment
uses: peter-evans/create-or-update-comment@v4
uses: peter-evans/create-or-update-comment@v5
with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
+2 -2
View File
@@ -19,7 +19,7 @@ Follow this guide to get started with a working `/example` command.
runs-on: ubuntu-latest
steps:
- name: Add reaction
uses: peter-evans/create-or-update-comment@v4
uses: peter-evans/create-or-update-comment@v5
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
@@ -56,7 +56,7 @@ Command processing setup is complete! Now we need to setup command dispatch for
runs-on: ubuntu-latest
steps:
- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v4
uses: peter-evans/slash-command-dispatch@v5
with:
token: ${{ secrets.PAT }}
commands: example
+10
View File
@@ -1,3 +1,13 @@
## Updating from `v4` to `v5`
### Breaking changes
- If using self-hosted runners or GitHub Enterprise Server, there are minimum requirements for `v5` to run. See "What's new" below for details.
### What's new
- Updated runtime to Node.js 24
- The action now requires a minimum version of [v2.327.1](https://github.com/actions/runner/releases/tag/v2.327.1) for the Actions runner. Update self-hosted runners to v2.327.1 or later to ensure compatibility.
## Updating from `v3` to `v4`
### Breaking changes
+4 -4
View File
@@ -36,7 +36,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v4
uses: peter-evans/slash-command-dispatch@v5
with:
token: ${{ secrets.PAT }}
commands: |
@@ -85,7 +85,7 @@ The simplest response is to add a :tada: reaction to the comment.
```yml
- name: Add reaction
uses: peter-evans/create-or-update-comment@v4
uses: peter-evans/create-or-update-comment@v5
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.inputs.repository }}
@@ -107,7 +107,7 @@ The `error-message` output can be used to provide feedback to the user as follow
```yml
- name: Slash Command Dispatch
id: scd
uses: peter-evans/slash-command-dispatch@v4
uses: peter-evans/slash-command-dispatch@v5
with:
token: ${{ secrets.PAT }}
commands: |
@@ -118,7 +118,7 @@ The `error-message` output can be used to provide feedback to the user as follow
- name: Edit comment with error message
if: steps.scd.outputs.error-message
uses: peter-evans/create-or-update-comment@v4
uses: peter-evans/create-or-update-comment@v5
with:
comment-id: ${{ github.event.comment.id }}
body: |
+224 -574
View File
File diff suppressed because it is too large Load Diff
+4 -1
View File
@@ -1,9 +1,12 @@
{
"name": "slash-command-dispatch",
"version": "4.0.0",
"version": "5.0.0",
"private": true,
"description": "Facilitates 'ChatOps' by creating dispatch events for slash commands",
"main": "lib/main.js",
"engines": {
"node": ">=24.4.0"
},
"scripts": {
"build": "tsc && ncc build",
"format": "prettier --write '**/*.ts'",