feat: update runtime to node 24
This commit is contained in:
@@ -17,7 +17,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version-file: package.json
|
||||||
cache: npm
|
cache: npm
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ on:
|
|||||||
type: choice
|
type: choice
|
||||||
description: The major version tag to update
|
description: The major version tag to update
|
||||||
options:
|
options:
|
||||||
- v4
|
- v5
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tag:
|
tag:
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Slash Command Dispatch
|
- name: Slash Command Dispatch
|
||||||
uses: peter-evans/slash-command-dispatch@v4
|
uses: peter-evans/slash-command-dispatch@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
commands: |
|
commands: |
|
||||||
@@ -102,7 +102,7 @@ You can use a [PAT](https://docs.github.com/en/github/authenticating-to-github/c
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: Slash Command Dispatch
|
- name: Slash Command Dispatch
|
||||||
uses: peter-evans/slash-command-dispatch@v4
|
uses: peter-evans/slash-command-dispatch@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
reaction-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.
|
To demonstrate, take the following configuration as an example.
|
||||||
```yml
|
```yml
|
||||||
- uses: peter-evans/slash-command-dispatch@v4
|
- uses: peter-evans/slash-command-dispatch@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
commands: |
|
commands: |
|
||||||
@@ -248,7 +248,7 @@ The simplest response is to add a :tada: reaction to the comment.
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: Add reaction
|
- name: Add reaction
|
||||||
uses: peter-evans/create-or-update-comment@v4
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
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
|
run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Create comment
|
- name: Create comment
|
||||||
uses: peter-evans/create-or-update-comment@v4
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
||||||
|
|||||||
+1
-1
@@ -41,7 +41,7 @@ outputs:
|
|||||||
error-message:
|
error-message:
|
||||||
description: 'Validation errors when using `workflow` dispatch.'
|
description: 'Validation errors when using `workflow` dispatch.'
|
||||||
runs:
|
runs:
|
||||||
using: 'node20'
|
using: 'node24'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
branding:
|
branding:
|
||||||
icon: 'target'
|
icon: 'target'
|
||||||
|
|||||||
Vendored
+5
-4
@@ -384,8 +384,8 @@ class GitHubHelper {
|
|||||||
if (count == 10)
|
if (count == 10)
|
||||||
break;
|
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 }));
|
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 '${workflowName}' in '${cmd.repository}'`);
|
core.info(`Command '${cmd.command}' dispatched to workflow '${workflow}' in '${cmd.repository}'`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
getWorkflow(repository, workflowName) {
|
getWorkflow(repository, workflowName) {
|
||||||
@@ -393,8 +393,9 @@ class GitHubHelper {
|
|||||||
core.debug(`Getting workflow ${workflowName} for repository ${repository}`);
|
core.debug(`Getting workflow ${workflowName} for repository ${repository}`);
|
||||||
const { data: workflows } = yield this.octokit.rest.actions.listRepoWorkflows(Object.assign({}, this.parseRepository(repository)));
|
const { data: workflows } = yield this.octokit.rest.actions.listRepoWorkflows(Object.assign({}, this.parseRepository(repository)));
|
||||||
for (const workflow of workflows.workflows) {
|
for (const workflow of workflows.workflows) {
|
||||||
if (workflow.path === `${workflowName}.yml` || workflow.path === `${workflowName}.yaml`) {
|
if (workflow.path === `${workflowName}.yml` ||
|
||||||
core.info(`Selecting workflow file ${workflow.path}`);
|
workflow.path === `${workflowName}.yaml`) {
|
||||||
|
core.debug(`Selecting workflow file ${workflow.path}`);
|
||||||
return workflow.path;
|
return workflow.path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ For example, the following basic configuration means that all commands must have
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: Slash Command Dispatch
|
- name: Slash Command Dispatch
|
||||||
uses: peter-evans/slash-command-dispatch@v4
|
uses: peter-evans/slash-command-dispatch@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
commands: |
|
commands: |
|
||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Slash Command Dispatch
|
- name: Slash Command Dispatch
|
||||||
uses: peter-evans/slash-command-dispatch@v4
|
uses: peter-evans/slash-command-dispatch@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
config: >
|
config: >
|
||||||
@@ -84,7 +84,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Slash Command Dispatch
|
- name: Slash Command Dispatch
|
||||||
uses: peter-evans/slash-command-dispatch@v4
|
uses: peter-evans/slash-command-dispatch@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
config-from-file: .github/slash-command-dispatch.json
|
config-from-file: .github/slash-command-dispatch.json
|
||||||
|
|||||||
+7
-7
@@ -50,7 +50,7 @@ jobs:
|
|||||||
|
|
||||||
# Add reaction to the comment
|
# Add reaction to the comment
|
||||||
- name: Add reaction
|
- name: Add reaction
|
||||||
uses: peter-evans/create-or-update-comment@v4
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
||||||
@@ -111,7 +111,7 @@ jobs:
|
|||||||
|
|
||||||
# Add reaction to the comment
|
# Add reaction to the comment
|
||||||
- name: Add reaction
|
- name: Add reaction
|
||||||
uses: peter-evans/create-or-update-comment@v4
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
||||||
@@ -158,7 +158,7 @@ jobs:
|
|||||||
git push
|
git push
|
||||||
|
|
||||||
- name: Add reaction
|
- name: Add reaction
|
||||||
uses: peter-evans/create-or-update-comment@v4
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
||||||
@@ -204,7 +204,7 @@ jobs:
|
|||||||
git push --force-with-lease
|
git push --force-with-lease
|
||||||
|
|
||||||
- name: Update comment
|
- name: Update comment
|
||||||
uses: peter-evans/create-or-update-comment@v4
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
||||||
@@ -218,7 +218,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Update comment
|
- name: Update comment
|
||||||
uses: peter-evans/create-or-update-comment@v4
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
||||||
@@ -279,7 +279,7 @@ jobs:
|
|||||||
git push
|
git push
|
||||||
|
|
||||||
- name: Add reaction
|
- name: Add reaction
|
||||||
uses: peter-evans/create-or-update-comment@v4
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
||||||
@@ -301,7 +301,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Update comment
|
- name: Update comment
|
||||||
uses: peter-evans/create-or-update-comment@v4
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
||||||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ Follow this guide to get started with a working `/example` command.
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Add reaction
|
- name: Add reaction
|
||||||
uses: peter-evans/create-or-update-comment@v4
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
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
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Slash Command Dispatch
|
- name: Slash Command Dispatch
|
||||||
uses: peter-evans/slash-command-dispatch@v4
|
uses: peter-evans/slash-command-dispatch@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
commands: example
|
commands: example
|
||||||
|
|||||||
@@ -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`
|
## Updating from `v3` to `v4`
|
||||||
|
|
||||||
### Breaking changes
|
### Breaking changes
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Slash Command Dispatch
|
- name: Slash Command Dispatch
|
||||||
uses: peter-evans/slash-command-dispatch@v4
|
uses: peter-evans/slash-command-dispatch@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
commands: |
|
commands: |
|
||||||
@@ -85,7 +85,7 @@ The simplest response is to add a :tada: reaction to the comment.
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: Add reaction
|
- name: Add reaction
|
||||||
uses: peter-evans/create-or-update-comment@v4
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
repository: ${{ github.event.inputs.repository }}
|
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
|
```yml
|
||||||
- name: Slash Command Dispatch
|
- name: Slash Command Dispatch
|
||||||
id: scd
|
id: scd
|
||||||
uses: peter-evans/slash-command-dispatch@v4
|
uses: peter-evans/slash-command-dispatch@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
commands: |
|
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
|
- name: Edit comment with error message
|
||||||
if: steps.scd.outputs.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:
|
with:
|
||||||
comment-id: ${{ github.event.comment.id }}
|
comment-id: ${{ github.event.comment.id }}
|
||||||
body: |
|
body: |
|
||||||
|
|||||||
Generated
+224
-574
File diff suppressed because it is too large
Load Diff
+4
-1
@@ -1,9 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "slash-command-dispatch",
|
"name": "slash-command-dispatch",
|
||||||
"version": "4.0.0",
|
"version": "5.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Facilitates 'ChatOps' by creating dispatch events for slash commands",
|
"description": "Facilitates 'ChatOps' by creating dispatch events for slash commands",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=24.4.0"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc && ncc build",
|
"build": "tsc && ncc build",
|
||||||
"format": "prettier --write '**/*.ts'",
|
"format": "prettier --write '**/*.ts'",
|
||||||
|
|||||||
Reference in New Issue
Block a user