Compare commits

...

51 Commits

Author SHA1 Message Date
dependabot[bot]
32e91bd2ce Bump @octokit/request from 8.1.1 to 8.4.1
Bumps [@octokit/request](https://github.com/octokit/request.js) from 8.1.1 to 8.4.1.
- [Release notes](https://github.com/octokit/request.js/releases)
- [Commits](https://github.com/octokit/request.js/compare/v8.1.1...v8.4.1)

---
updated-dependencies:
- dependency-name: "@octokit/request"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-02 14:57:05 +00:00
Josh Gross
e7aeb8c663 Merge pull request #575 from actions/dependabot/github_actions/ruby/setup-ruby-1.229.0
Bump ruby/setup-ruby from 1.222.0 to 1.229.0
2025-04-02 10:56:06 -04:00
dependabot[bot]
5b5837ac81 Bump ruby/setup-ruby from 1.222.0 to 1.229.0
Bumps [ruby/setup-ruby](https://github.com/ruby/setup-ruby) from 1.222.0 to 1.229.0.
- [Release notes](https://github.com/ruby/setup-ruby/releases)
- [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb)
- [Commits](277ba2a127...354a1ad156)

---
updated-dependencies:
- dependency-name: ruby/setup-ruby
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-31 19:45:58 +00:00
Josh Gross
3908079ba1 Merge pull request #563 from actions/dependabot/github_actions/ruby/setup-ruby-1.222.0
Bump ruby/setup-ruby from 1.213.0 to 1.222.0
2025-03-10 15:14:55 -04:00
dependabot[bot]
14b73c4a7e Bump ruby/setup-ruby from 1.213.0 to 1.222.0
Bumps [ruby/setup-ruby](https://github.com/ruby/setup-ruby) from 1.213.0 to 1.222.0.
- [Release notes](https://github.com/ruby/setup-ruby/releases)
- [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb)
- [Commits](28c4deda89...277ba2a127)

---
updated-dependencies:
- dependency-name: ruby/setup-ruby
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-10 19:08:31 +00:00
Josh Gross
62c3794a3e Merge pull request #546 from neilime/patch-1
docs: add "exec" usage examples
2025-03-05 15:32:44 -05:00
Emilien Escalle
ea5430244c Merge branch 'actions:main' into patch-1 2025-03-04 07:29:17 +01:00
Josh Gross
d0bdabac5f Merge pull request #557 from actions/joshmgross/fix-readme-v7
Remove `octokit` README updates for v7
2025-02-26 14:46:35 -05:00
Josh Gross
851500a2ad Remove octokit README updates for v7
https://github.com/actions/github-script/issues/545
2025-02-26 14:38:00 -05:00
Emilien Escalle
86ac1371ea docs: add "exec" usage examples 2025-02-17 11:50:46 +01:00
Josh Gross
378a50fac5 Merge pull request #508 from iamstarkov/patch-2
make octokit instance available as octokit on top of github, to make it easier to seamlessly copy examples from GitHub rest api or octokit documentations
2025-02-04 14:47:03 -05:00
Vladimir Starkov
632050422e fix: adjust types 2025-01-31 11:55:53 +01:00
Vladimir Starkov
f23cd47e29 replace GitHub with octokit in the README, but keep a note of the GitHub still being available 2025-01-31 11:20:25 +01:00
Vladimir Starkov
4024541289 make octokit instance available as octokit on top of github, to make it easier to seamless to copy examples from GitHub api or octokit documentation 2025-01-31 11:20:25 +01:00
Josh Gross
91a83c0917 Merge pull request #473 from nschonni/upstream-setup-license
ci: Use github/setup-licensed
2025-01-29 11:34:59 -05:00
Josh Gross
586a6a1c85 Merge branch 'main' into upstream-setup-license 2025-01-29 11:31:44 -05:00
Josh Gross
8cf50d1501 Merge pull request #533 from nschonni/remove-vscode
chore: Remove .vscode settings
2025-01-29 11:30:27 -05:00
Josh Gross
511abaae1c Merge branch 'main' into remove-vscode 2025-01-29 11:22:32 -05:00
Josh Gross
eb88965f42 Merge pull request #532 from nschonni/sub-action-dependabot
chore: Add Dependabot for .github/actions/install-dependencies
2025-01-29 11:22:24 -05:00
Josh Gross
eef4fd9090 Merge branch 'main' into remove-vscode 2025-01-29 11:22:16 -05:00
Josh Gross
6efc7571cb Merge branch 'main' into sub-action-dependabot 2025-01-29 11:21:01 -05:00
Josh Gross
08caaddc54 Merge pull request #531 from actions/joshmgross/update-workflows
Define `permissions` in workflows and update actions
2025-01-29 11:20:46 -05:00
Nick Schonning
ac230a1936 chore: Remove .vscode settings 2025-01-28 17:18:57 -05:00
Nick Schonning
8e643f1530 chore: Add Dependabot for .github/actions/install-dependencies 2025-01-28 17:04:29 -05:00
Josh Gross
19e58d8525 Define permissions in workflows and update actions 2025-01-28 16:50:07 -05:00
Josh Gross
c94e1c45ff Merge pull request #472 from nschonni/setup-dependabot
chore: Add Dependabot for NPM and Actions
2025-01-28 16:36:48 -05:00
Josh Gross
3e8cf0fede Merge branch 'main' into setup-dependabot 2025-01-28 16:35:38 -05:00
Nick Schonning
fd2cfc12fa ci: pin ruby/setup-ruby 2025-01-25 16:18:58 -05:00
Nick Schonning
f2f7f58db4 ci: Use github/setup-licensed 2025-01-25 16:15:22 -05:00
Josh Gross
d70566966b Merge pull request #478 from timotk/patch-1
Specify that the used script is JavaScript
2025-01-17 15:31:49 -05:00
Josh Gross
ec12a47a4a Merge branch 'main' into patch-1 2025-01-17 15:14:36 -05:00
Josh Gross
ac452803c9 Merge pull request #515 from actions/joshmgross/npm-audit-fix
Update dependencies with `npm audit fix`
2025-01-17 15:06:43 -05:00
Josh Gross
1acfa1ca49 Merge branch 'main' into joshmgross/npm-audit-fix 2025-01-17 15:03:08 -05:00
Josh Gross
c6fc059534 Merge pull request #514 from actions/joshmgross/update-package-name
Clear up package name confusion
2025-01-17 15:00:06 -05:00
Josh Gross
766f5ddf0e Update licenses 2025-01-17 14:58:40 -05:00
Josh Gross
5e738b47b5 Update dependencies with npm audit fix 2025-01-17 14:56:43 -05:00
Josh Gross
2f5a0ceb1a Update integration test for expected package name 2025-01-17 14:44:04 -05:00
Josh Gross
7875aed44f Clear up package name confusion 2025-01-17 14:37:40 -05:00
Josh Gross
2bcb242a0a Merge pull request #512 from actions/joshmgross/upload-artifact-update
Update usage of `actions/upload-artifact`
2025-01-17 13:48:42 -05:00
Josh Gross
a32a57a185 Update usage of actions/upload-artifact 2025-01-16 15:53:49 -05:00
Josh Gross
4020e461ac Merge pull request #497 from actions/joshmgross/fix-status-badges
Fix workflow status badges
2024-11-04 10:31:56 -05:00
Josh Gross
ec3a5c4c4c Fix workflow status badges 2024-11-01 18:11:15 -04:00
Joel Ambass
660ec11d82 Merge pull request #486 from actions/Jcambass-patch-1
Upgrade IA Publish
2024-09-17 08:47:55 +02:00
Joel Ambass
c0ceea4835 Upgrade IA Publish 2024-09-16 17:19:19 +02:00
Joel Ambass
58d7008c60 Merge pull request #485 from actions/Jcambass-patch-1
Add workflow file for publishing releases to immutable action package
2024-09-13 16:53:23 +02:00
Joel Ambass
b9f8f75f36 Add workflow file for publishing releases to immutable action package
This workflow file publishes new action releases to the immutable action package of the same name as this repo.

This is part of the Immutable Actions project which is not yet fully released to the public. First party actions like this one are part of our initial testing of this feature.
2024-09-13 13:35:58 +02:00
Josh Gross
35b1cdd1b2 Merge pull request #482 from benelan/main
Upgrade husky to v9
2024-07-29 16:07:40 -04:00
Ben Elan
3c6a5c5d52 empty commit 2024-07-26 18:10:15 -07:00
Ben Elan
c44be22d0b Upgrade husky to v9 2024-07-24 20:48:36 -07:00
Timo
adfd270e4b Specify that the script is JavaScript 2024-07-10 10:44:37 +02:00
Nick Schonning
adc04e7dd8 chore: Add Dependabot for NPM and Actions 2024-06-03 18:13:31 -04:00
21 changed files with 1398 additions and 587 deletions

View File

@@ -3,7 +3,7 @@ description: 'Set up node and install dependencies'
runs: runs:
using: 'composite' using: 'composite'
steps: steps:
- uses: actions/setup-node@v3 - uses: actions/setup-node@v4
with: with:
node-version: '20.x' node-version: '20.x'
cache: npm cache: npm

16
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
- package-ecosystem: 'github-actions'
directory: '/.github/actions/install-dependencies'
schedule:
interval: 'weekly'
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'

View File

@@ -13,12 +13,15 @@ on:
pull_request: pull_request:
workflow_dispatch: workflow_dispatch:
permissions:
contents: read
jobs: jobs:
check-dist: check-dist:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: ./.github/actions/install-dependencies - uses: ./.github/actions/install-dependencies
@@ -35,7 +38,7 @@ jobs:
id: diff id: diff
# If index.js was different than expected, upload the expected version as an artifact # If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v4
if: ${{ failure() && steps.diff.conclusion == 'failure' }} if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with: with:
name: dist name: dist

View File

@@ -6,11 +6,14 @@ on:
pull_request: pull_request:
branches: [main] branches: [main]
permissions:
contents: read
jobs: jobs:
ci: ci:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: ./.github/actions/install-dependencies - uses: ./.github/actions/install-dependencies
- run: npm run style:check - run: npm run style:check
- run: npm test - run: npm test

View File

@@ -38,11 +38,11 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v2 uses: github/codeql-action/init@v3
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file. # If you wish to specify custom queries, you can do so here or in a config file.
@@ -56,7 +56,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below) # If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@v2 uses: github/codeql-action/autobuild@v3
# Command-line programs to run using the OS shell. # Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -69,4 +69,4 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh # ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2 uses: github/codeql-action/analyze@v3

View File

@@ -6,12 +6,15 @@ on:
pull_request: pull_request:
branches: [main] branches: [main]
permissions:
contents: read
jobs: jobs:
test-return: test-return:
name: 'Integration test: return' name: 'Integration test: return'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- id: output-set - id: output-set
uses: ./ uses: ./
with: with:
@@ -31,7 +34,7 @@ jobs:
name: 'Integration test: relative-path require' name: 'Integration test: relative-path require'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- id: relative-require - id: relative-require
uses: ./ uses: ./
with: with:
@@ -39,7 +42,7 @@ jobs:
result-encoding: string result-encoding: string
- run: | - run: |
echo "- Validating relative require output" echo "- Validating relative require output"
if [[ "${{steps.relative-require.outputs.result}}" != "github-script" ]]; then if [[ "${{steps.relative-require.outputs.result}}" != "@actions/github-script" ]]; then
echo $'::error::\u274C' "Expected '$expected', got ${{steps.relative-require.outputs.result}}" echo $'::error::\u274C' "Expected '$expected', got ${{steps.relative-require.outputs.result}}"
exit 1 exit 1
fi fi
@@ -49,7 +52,7 @@ jobs:
name: 'Integration test: npm package require' name: 'Integration test: npm package require'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: ./.github/actions/install-dependencies - uses: ./.github/actions/install-dependencies
- id: npm-require - id: npm-require
uses: ./ uses: ./
@@ -69,7 +72,7 @@ jobs:
name: 'Integration test: GraphQL previews option' name: 'Integration test: GraphQL previews option'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: ./.github/actions/install-dependencies - uses: ./.github/actions/install-dependencies
- id: previews-default - id: previews-default
name: Default previews not set name: Default previews not set
@@ -122,7 +125,7 @@ jobs:
name: 'Integration test: user-agent option' name: 'Integration test: user-agent option'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: ./.github/actions/install-dependencies - uses: ./.github/actions/install-dependencies
- id: user-agent-default - id: user-agent-default
name: Default user-agent not set name: Default user-agent not set
@@ -179,7 +182,7 @@ jobs:
name: "Integration test: debug option (runner.debug mode ${{ matrix.environment && 'enabled' || 'disabled' }})" name: "Integration test: debug option (runner.debug mode ${{ matrix.environment && 'enabled' || 'disabled' }})"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: ./.github/actions/install-dependencies - uses: ./.github/actions/install-dependencies
- id: debug-default - id: debug-default
name: Default debug not set name: Default debug not set
@@ -253,7 +256,7 @@ jobs:
name: 'Integration test: base-url option' name: 'Integration test: base-url option'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: ./.github/actions/install-dependencies - uses: ./.github/actions/install-dependencies
- id: base-url-default - id: base-url-default

View File

@@ -8,17 +8,23 @@ on:
branches: branches:
- main - main
permissions:
contents: read
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Check licenses name: Check licenses
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 # prefer to use a full fetch for licensed workflows fetch-depth: 0 # prefer to use a full fetch for licensed workflows
# https://github.com/jonabc/setup-licensed/releases/tag/v1.1.1 - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1.229.0
- uses: jonabc/setup-licensed@82c5f4d19e8968efa74a25b132922382c2671fe2
with: with:
version: '3.x' ruby-version: ruby
- uses: github/setup-licensed@v1
with:
version: '4.x'
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/install-dependencies - uses: ./.github/actions/install-dependencies
- run: licensed status - run: licensed status

View File

@@ -0,0 +1,20 @@
name: 'Publish Immutable Action Version'
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Checking out
uses: actions/checkout@v4
- name: Publish
id: publish
uses: actions/publish-immutable-action@0.0.4

View File

@@ -5,11 +5,15 @@ on:
branches: [main] branches: [main]
types: [opened, synchronize] types: [opened, synchronize]
permissions:
contents: read
pull-requests: write
jobs: jobs:
pull-request-test: pull-request-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: ./ - uses: ./
with: with:
script: | script: |

View File

@@ -1,31 +0,0 @@
name: Stale Issues & PRs
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
mark_stale:
name: Mark issues and PRs as stale
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
exempt-issue-labels: Not Stale
exempt-pr-labels: Not Stale
stale-issue-message: >
This issue is stale because it has been open for 60 days with no
activity. Remove the "Stale" label or comment on the issue, or it
will be closed in 7 days.
stale-pr-message: >
This pull request is stale because it has been open for 60 days
with no activity. Remove the "Stale" label or comment on the pull
request, or it will be closed in 7 days.
close-issue-message: >
This issue has been marked as stale and closed due to no activity
on it.
close-pr-message: >
This pull request has been marked as stale and closed due to no
activity on it.

1
.gitignore vendored
View File

@@ -1,2 +1 @@
/node_modules/ /node_modules/
!/.vscode/

View File

@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npm run pre-commit && git add dist/ npm run pre-commit && git add dist/

View File

@@ -1,6 +1,6 @@
--- ---
name: undici name: undici
version: 5.26.3 version: 5.28.5
type: npm type: npm
summary: An HTTP/1.1 client, written from scratch for Node.js summary: An HTTP/1.1 client, written from scratch for Node.js
homepage: https://undici.nodejs.org homepage: https://undici.nodejs.org

10
.vscode/settings.json vendored
View File

@@ -1,10 +0,0 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"files.exclude": {
"**/dist": true,
"**/node_modules": true
}
}

View File

@@ -1,13 +1,13 @@
# actions/github-script # actions/github-script
[![.github/workflows/integration.yml](https://github.com/actions/github-script/workflows/Integration/badge.svg?event=push&branch=main)](https://github.com/actions/github-script/actions?query=workflow%3AIntegration+branch%3Amain+event%3Apush) [![Integration](https://github.com/actions/github-script/actions/workflows/integration.yml/badge.svg?branch=main&event=push)](https://github.com/actions/github-script/actions/workflows/integration.yml)
[![.github/workflows/ci.yml](https://github.com/actions/github-script/workflows/CI/badge.svg?event=push&branch=main)](https://github.com/actions/github-script/actions?query=workflow%3ACI+branch%3Amain+event%3Apush) [![CI](https://github.com/actions/github-script/actions/workflows/ci.yml/badge.svg?branch=main&event=push)](https://github.com/actions/github-script/actions/workflows/ci.yml)
[![.github/workflows/licensed.yml](https://github.com/actions/github-script/workflows/Licensed/badge.svg?event=push&branch=main)](https://github.com/actions/github-script/actions?query=workflow%3ALicensed+branch%3Amain+event%3Apush) [![Licensed](https://github.com/actions/github-script/actions/workflows/licensed.yml/badge.svg?branch=main&event=push)](https://github.com/actions/github-script/actions/workflows/licensed.yml)
This action makes it easy to quickly write a script in your workflow that This action makes it easy to quickly write a script in your workflow that
uses the GitHub API and the workflow run context. uses the GitHub API and the workflow run context.
To use this action, provide an input named `script` that contains the body of an asynchronous function call. To use this action, provide an input named `script` that contains the body of an asynchronous JavaScript function call.
The following arguments will be provided: The following arguments will be provided:
- `github` A pre-authenticated - `github` A pre-authenticated
@@ -305,7 +305,7 @@ jobs:
echo-input: echo-input:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/github-script@v7 - uses: actions/github-script@v7
with: with:
script: | script: |
@@ -343,7 +343,7 @@ jobs:
echo-input: echo-input:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/github-script@v7 - uses: actions/github-script@v7
env: env:
SHA: '${{env.parentSHA}}' SHA: '${{env.parentSHA}}'
@@ -381,8 +381,8 @@ jobs:
echo-input: echo-input:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/setup-node@v3 - uses: actions/setup-node@v4
with: with:
node-version: '20.x' node-version: '20.x'
- run: npm ci - run: npm ci
@@ -417,7 +417,7 @@ jobs:
print-stuff: print-stuff:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/github-script@v7 - uses: actions/github-script@v7
with: with:
script: | script: |
@@ -429,15 +429,15 @@ jobs:
### Use scripts with jsDoc support ### Use scripts with jsDoc support
If you want type support for your scripts, you could use the command below to install the If you want type support for your scripts, you could use the command below to install the
`github-script` type declaration. `@actions/github-script` type declaration.
```sh ```sh
$ npm i -D @types/github-script@github:actions/github-script $ npm i -D @actions/github-script@github:actions/github-script
``` ```
And then add the `jsDoc` declaration to your script like this: And then add the `jsDoc` declaration to your script like this:
```js ```js
// @ts-check // @ts-check
/** @param {import('@types/github-script').AsyncFunctionArguments} AsyncFunctionArguments */ /** @param {import('@actions/github-script').AsyncFunctionArguments} AsyncFunctionArguments */
export default async ({ core, context }) => { export default async ({ core, context }) => {
core.debug("Running something at the moment"); core.debug("Running something at the moment");
return context.actor; return context.actor;
@@ -494,3 +494,45 @@ jobs:
labels: ['Triage'] labels: ['Triage']
}) })
``` ```
### Using exec package
The provided [@actions/exec](https://github.com/actions/toolkit/tree/main/packages/exec) package allows to execute command or tools in a cross platform way:
```yaml
on: push
jobs:
use-exec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/github-script@v7
with:
script: |
const exitCode = await exec.exec('echo', ['hello'])
console.log(exitCode)
```
`exec` packages provides `getExecOutput` function to retrieve stdout and stderr from executed command:
```yaml
on: push
jobs:
use-get-exec-output:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/github-script@v7
with:
script: |
const {
exitCode,
stdout,
stderr
} = await exec.getExecOutput('echo', ['hello']);
console.log(exitCode, stdout, stderr)
```

1424
dist/index.js vendored

File diff suppressed because it is too large Load Diff

304
package-lock.json generated
View File

@@ -1,11 +1,11 @@
{ {
"name": "github-script", "name": "@actions/github-script",
"version": "7.0.1", "version": "7.0.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "github-script", "name": "@actions/github-script",
"version": "7.0.1", "version": "7.0.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -27,7 +27,7 @@
"eslint": "^8.51.0", "eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0", "eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1", "eslint-plugin-prettier": "^5.0.1",
"husky": "^7.0.0", "husky": "^9.1.1",
"jest": "^29.7.0", "jest": "^29.7.0",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"prettier": "^3.0.3", "prettier": "^3.0.3",
@@ -1293,12 +1293,12 @@
} }
}, },
"node_modules/@octokit/endpoint": { "node_modules/@octokit/endpoint": {
"version": "9.0.0", "version": "9.0.6",
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.6.tgz",
"integrity": "sha512-szrQhiqJ88gghWY2Htt8MqUDO6++E/EIXqJ2ZEp5ma3uGS46o7LZAzSLt49myB7rT+Hfw5Y6gO3LmOxGzHijAQ==", "integrity": "sha512-H1fNTMA57HbkFESSt3Y9+FBICv+0jFceJFPWDePYlR/iMGrwM5ph+Dd4XRQs+8X+PUFURLQgX9ChPfhJ/1uNQw==",
"license": "MIT",
"dependencies": { "dependencies": {
"@octokit/types": "^11.0.0", "@octokit/types": "^13.1.0",
"is-plain-object": "^5.0.0",
"universal-user-agent": "^6.0.0" "universal-user-agent": "^6.0.0"
}, },
"engines": { "engines": {
@@ -1306,16 +1306,18 @@
} }
}, },
"node_modules/@octokit/endpoint/node_modules/@octokit/openapi-types": { "node_modules/@octokit/endpoint/node_modules/@octokit/openapi-types": {
"version": "18.0.0", "version": "24.2.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.0.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz",
"integrity": "sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw==" "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==",
"license": "MIT"
}, },
"node_modules/@octokit/endpoint/node_modules/@octokit/types": { "node_modules/@octokit/endpoint/node_modules/@octokit/types": {
"version": "11.1.0", "version": "13.10.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-11.1.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz",
"integrity": "sha512-Fz0+7GyLm/bHt8fwEqgvRBWwIV1S6wRRyq+V6exRKLVWaKGsuy6H9QFYeBVDV7rK6fO3XwHgQOPxv+cLj2zpXQ==", "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==",
"license": "MIT",
"dependencies": { "dependencies": {
"@octokit/openapi-types": "^18.0.0" "@octokit/openapi-types": "^24.2.0"
} }
}, },
"node_modules/@octokit/graphql": { "node_modules/@octokit/graphql": {
@@ -1405,14 +1407,14 @@
} }
}, },
"node_modules/@octokit/request": { "node_modules/@octokit/request": {
"version": "8.1.1", "version": "8.4.1",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.1.1.tgz", "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.1.tgz",
"integrity": "sha512-8N+tdUz4aCqQmXl8FpHYfKG9GelDFd7XGVzyN8rc6WxVlYcfpHECnuRkgquzz+WzvHTK62co5di8gSXnzASZPQ==", "integrity": "sha512-qnB2+SY3hkCmBxZsR/MPCybNmbJe4KAlfWErXq+rBKkQJlbjdJeS85VI9r8UqeLYLvnAenU8Q1okM/0MBsAGXw==",
"license": "MIT",
"dependencies": { "dependencies": {
"@octokit/endpoint": "^9.0.0", "@octokit/endpoint": "^9.0.6",
"@octokit/request-error": "^5.0.0", "@octokit/request-error": "^5.1.1",
"@octokit/types": "^11.1.0", "@octokit/types": "^13.1.0",
"is-plain-object": "^5.0.0",
"universal-user-agent": "^6.0.0" "universal-user-agent": "^6.0.0"
}, },
"engines": { "engines": {
@@ -1420,11 +1422,12 @@
} }
}, },
"node_modules/@octokit/request-error": { "node_modules/@octokit/request-error": {
"version": "5.0.0", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.0.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.1.tgz",
"integrity": "sha512-1ue0DH0Lif5iEqT52+Rf/hf0RmGO9NWFjrzmrkArpG9trFfDM/efx00BJHdLGuro4BR/gECxCU2Twf5OKrRFsQ==", "integrity": "sha512-v9iyEQJH6ZntoENr9/yXxjuezh4My67CBSu9r6Ve/05Iu5gNgnisNWOsoJHTP6k0Rr0+HQIpnH+kyammu90q/g==",
"license": "MIT",
"dependencies": { "dependencies": {
"@octokit/types": "^11.0.0", "@octokit/types": "^13.1.0",
"deprecation": "^2.0.0", "deprecation": "^2.0.0",
"once": "^1.4.0" "once": "^1.4.0"
}, },
@@ -1433,29 +1436,33 @@
} }
}, },
"node_modules/@octokit/request-error/node_modules/@octokit/openapi-types": { "node_modules/@octokit/request-error/node_modules/@octokit/openapi-types": {
"version": "18.0.0", "version": "24.2.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.0.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz",
"integrity": "sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw==" "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==",
"license": "MIT"
}, },
"node_modules/@octokit/request-error/node_modules/@octokit/types": { "node_modules/@octokit/request-error/node_modules/@octokit/types": {
"version": "11.1.0", "version": "13.10.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-11.1.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz",
"integrity": "sha512-Fz0+7GyLm/bHt8fwEqgvRBWwIV1S6wRRyq+V6exRKLVWaKGsuy6H9QFYeBVDV7rK6fO3XwHgQOPxv+cLj2zpXQ==", "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==",
"license": "MIT",
"dependencies": { "dependencies": {
"@octokit/openapi-types": "^18.0.0" "@octokit/openapi-types": "^24.2.0"
} }
}, },
"node_modules/@octokit/request/node_modules/@octokit/openapi-types": { "node_modules/@octokit/request/node_modules/@octokit/openapi-types": {
"version": "18.0.0", "version": "24.2.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.0.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz",
"integrity": "sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw==" "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==",
"license": "MIT"
}, },
"node_modules/@octokit/request/node_modules/@octokit/types": { "node_modules/@octokit/request/node_modules/@octokit/types": {
"version": "11.1.0", "version": "13.10.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-11.1.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz",
"integrity": "sha512-Fz0+7GyLm/bHt8fwEqgvRBWwIV1S6wRRyq+V6exRKLVWaKGsuy6H9QFYeBVDV7rK6fO3XwHgQOPxv+cLj2zpXQ==", "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==",
"license": "MIT",
"dependencies": { "dependencies": {
"@octokit/openapi-types": "^18.0.0" "@octokit/openapi-types": "^24.2.0"
} }
}, },
"node_modules/@octokit/types": { "node_modules/@octokit/types": {
@@ -1487,9 +1494,9 @@
} }
}, },
"node_modules/@pkgr/utils/node_modules/cross-spawn": { "node_modules/@pkgr/utils/node_modules/cross-spawn": {
"version": "7.0.3", "version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"path-key": "^3.1.0", "path-key": "^3.1.0",
@@ -2281,12 +2288,12 @@
} }
}, },
"node_modules/braces": { "node_modules/braces": {
"version": "3.0.2", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"fill-range": "^7.0.1" "fill-range": "^7.1.1"
}, },
"engines": { "engines": {
"node": ">=8" "node": ">=8"
@@ -2606,9 +2613,9 @@
} }
}, },
"node_modules/cross-spawn": { "node_modules/cross-spawn": {
"version": "6.0.5", "version": "6.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz",
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"nice-try": "^1.0.4", "nice-try": "^1.0.4",
@@ -2702,9 +2709,9 @@
} }
}, },
"node_modules/default-browser/node_modules/cross-spawn": { "node_modules/default-browser/node_modules/cross-spawn": {
"version": "7.0.3", "version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"path-key": "^3.1.0", "path-key": "^3.1.0",
@@ -3216,9 +3223,9 @@
} }
}, },
"node_modules/eslint/node_modules/cross-spawn": { "node_modules/eslint/node_modules/cross-spawn": {
"version": "7.0.3", "version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"path-key": "^3.1.0", "path-key": "^3.1.0",
@@ -3474,9 +3481,9 @@
} }
}, },
"node_modules/execa/node_modules/cross-spawn": { "node_modules/execa/node_modules/cross-spawn": {
"version": "7.0.3", "version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"path-key": "^3.1.0", "path-key": "^3.1.0",
@@ -3649,9 +3656,9 @@
} }
}, },
"node_modules/fill-range": { "node_modules/fill-range": {
"version": "7.0.1", "version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"to-regex-range": "^5.0.1" "to-regex-range": "^5.0.1"
@@ -4045,15 +4052,15 @@
} }
}, },
"node_modules/husky": { "node_modules/husky": {
"version": "7.0.2", "version": "9.1.1",
"resolved": "https://registry.npmjs.org/husky/-/husky-7.0.2.tgz", "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.1.tgz",
"integrity": "sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg==", "integrity": "sha512-fCqlqLXcBnXa/TJXmT93/A36tJsjdJkibQ1MuIiFyCCYUlpYpIaj2mv1w+3KR6Rzu1IC3slFTje5f6DUp2A2rg==",
"dev": true, "dev": true,
"bin": { "bin": {
"husky": "lib/bin.js" "husky": "bin.js"
}, },
"engines": { "engines": {
"node": ">=12" "node": ">=18"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/typicode" "url": "https://github.com/sponsors/typicode"
@@ -4346,14 +4353,6 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/is-plain-object": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-regex": { "node_modules/is-regex": {
"version": "1.1.4", "version": "1.1.4",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
@@ -5749,12 +5748,12 @@
} }
}, },
"node_modules/micromatch": { "node_modules/micromatch": {
"version": "4.0.5", "version": "4.0.8",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
"integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"braces": "^3.0.2", "braces": "^3.0.3",
"picomatch": "^2.3.1" "picomatch": "^2.3.1"
}, },
"engines": { "engines": {
@@ -7102,9 +7101,9 @@
} }
}, },
"node_modules/undici": { "node_modules/undici": {
"version": "5.26.3", "version": "5.28.5",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.26.3.tgz", "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz",
"integrity": "sha512-H7n2zmKEWgOllKkIUkLvFmsJQj062lSm3uA4EYApG8gLuiOM0/go9bIoC3HVaSnfg4xunowDE2i9p8drkXuvDw==", "integrity": "sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==",
"dependencies": { "dependencies": {
"@fastify/busboy": "^2.0.0" "@fastify/busboy": "^2.0.0"
}, },
@@ -8322,26 +8321,25 @@
} }
}, },
"@octokit/endpoint": { "@octokit/endpoint": {
"version": "9.0.0", "version": "9.0.6",
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.6.tgz",
"integrity": "sha512-szrQhiqJ88gghWY2Htt8MqUDO6++E/EIXqJ2ZEp5ma3uGS46o7LZAzSLt49myB7rT+Hfw5Y6gO3LmOxGzHijAQ==", "integrity": "sha512-H1fNTMA57HbkFESSt3Y9+FBICv+0jFceJFPWDePYlR/iMGrwM5ph+Dd4XRQs+8X+PUFURLQgX9ChPfhJ/1uNQw==",
"requires": { "requires": {
"@octokit/types": "^11.0.0", "@octokit/types": "^13.1.0",
"is-plain-object": "^5.0.0",
"universal-user-agent": "^6.0.0" "universal-user-agent": "^6.0.0"
}, },
"dependencies": { "dependencies": {
"@octokit/openapi-types": { "@octokit/openapi-types": {
"version": "18.0.0", "version": "24.2.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.0.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz",
"integrity": "sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw==" "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg=="
}, },
"@octokit/types": { "@octokit/types": {
"version": "11.1.0", "version": "13.10.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-11.1.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz",
"integrity": "sha512-Fz0+7GyLm/bHt8fwEqgvRBWwIV1S6wRRyq+V6exRKLVWaKGsuy6H9QFYeBVDV7rK6fO3XwHgQOPxv+cLj2zpXQ==", "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==",
"requires": { "requires": {
"@octokit/openapi-types": "^18.0.0" "@octokit/openapi-types": "^24.2.0"
} }
} }
} }
@@ -8409,53 +8407,52 @@
} }
}, },
"@octokit/request": { "@octokit/request": {
"version": "8.1.1", "version": "8.4.1",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.1.1.tgz", "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.1.tgz",
"integrity": "sha512-8N+tdUz4aCqQmXl8FpHYfKG9GelDFd7XGVzyN8rc6WxVlYcfpHECnuRkgquzz+WzvHTK62co5di8gSXnzASZPQ==", "integrity": "sha512-qnB2+SY3hkCmBxZsR/MPCybNmbJe4KAlfWErXq+rBKkQJlbjdJeS85VI9r8UqeLYLvnAenU8Q1okM/0MBsAGXw==",
"requires": { "requires": {
"@octokit/endpoint": "^9.0.0", "@octokit/endpoint": "^9.0.6",
"@octokit/request-error": "^5.0.0", "@octokit/request-error": "^5.1.1",
"@octokit/types": "^11.1.0", "@octokit/types": "^13.1.0",
"is-plain-object": "^5.0.0",
"universal-user-agent": "^6.0.0" "universal-user-agent": "^6.0.0"
}, },
"dependencies": { "dependencies": {
"@octokit/openapi-types": { "@octokit/openapi-types": {
"version": "18.0.0", "version": "24.2.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.0.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz",
"integrity": "sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw==" "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg=="
}, },
"@octokit/types": { "@octokit/types": {
"version": "11.1.0", "version": "13.10.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-11.1.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz",
"integrity": "sha512-Fz0+7GyLm/bHt8fwEqgvRBWwIV1S6wRRyq+V6exRKLVWaKGsuy6H9QFYeBVDV7rK6fO3XwHgQOPxv+cLj2zpXQ==", "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==",
"requires": { "requires": {
"@octokit/openapi-types": "^18.0.0" "@octokit/openapi-types": "^24.2.0"
} }
} }
} }
}, },
"@octokit/request-error": { "@octokit/request-error": {
"version": "5.0.0", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.0.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.1.tgz",
"integrity": "sha512-1ue0DH0Lif5iEqT52+Rf/hf0RmGO9NWFjrzmrkArpG9trFfDM/efx00BJHdLGuro4BR/gECxCU2Twf5OKrRFsQ==", "integrity": "sha512-v9iyEQJH6ZntoENr9/yXxjuezh4My67CBSu9r6Ve/05Iu5gNgnisNWOsoJHTP6k0Rr0+HQIpnH+kyammu90q/g==",
"requires": { "requires": {
"@octokit/types": "^11.0.0", "@octokit/types": "^13.1.0",
"deprecation": "^2.0.0", "deprecation": "^2.0.0",
"once": "^1.4.0" "once": "^1.4.0"
}, },
"dependencies": { "dependencies": {
"@octokit/openapi-types": { "@octokit/openapi-types": {
"version": "18.0.0", "version": "24.2.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.0.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz",
"integrity": "sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw==" "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg=="
}, },
"@octokit/types": { "@octokit/types": {
"version": "11.1.0", "version": "13.10.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-11.1.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz",
"integrity": "sha512-Fz0+7GyLm/bHt8fwEqgvRBWwIV1S6wRRyq+V6exRKLVWaKGsuy6H9QFYeBVDV7rK6fO3XwHgQOPxv+cLj2zpXQ==", "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==",
"requires": { "requires": {
"@octokit/openapi-types": "^18.0.0" "@octokit/openapi-types": "^24.2.0"
} }
} }
} }
@@ -8483,9 +8480,9 @@
}, },
"dependencies": { "dependencies": {
"cross-spawn": { "cross-spawn": {
"version": "7.0.3", "version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true, "dev": true,
"requires": { "requires": {
"path-key": "^3.1.0", "path-key": "^3.1.0",
@@ -9074,12 +9071,12 @@
} }
}, },
"braces": { "braces": {
"version": "3.0.2", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
"dev": true, "dev": true,
"requires": { "requires": {
"fill-range": "^7.0.1" "fill-range": "^7.1.1"
} }
}, },
"browserslist": { "browserslist": {
@@ -9302,9 +9299,9 @@
} }
}, },
"cross-spawn": { "cross-spawn": {
"version": "6.0.5", "version": "6.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz",
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==",
"dev": true, "dev": true,
"requires": { "requires": {
"nice-try": "^1.0.4", "nice-try": "^1.0.4",
@@ -9355,9 +9352,9 @@
}, },
"dependencies": { "dependencies": {
"cross-spawn": { "cross-spawn": {
"version": "7.0.3", "version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true, "dev": true,
"requires": { "requires": {
"path-key": "^3.1.0", "path-key": "^3.1.0",
@@ -9701,9 +9698,9 @@
} }
}, },
"cross-spawn": { "cross-spawn": {
"version": "7.0.3", "version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true, "dev": true,
"requires": { "requires": {
"path-key": "^3.1.0", "path-key": "^3.1.0",
@@ -9900,9 +9897,9 @@
}, },
"dependencies": { "dependencies": {
"cross-spawn": { "cross-spawn": {
"version": "7.0.3", "version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true, "dev": true,
"requires": { "requires": {
"path-key": "^3.1.0", "path-key": "^3.1.0",
@@ -10045,9 +10042,9 @@
} }
}, },
"fill-range": { "fill-range": {
"version": "7.0.1", "version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
"dev": true, "dev": true,
"requires": { "requires": {
"to-regex-range": "^5.0.1" "to-regex-range": "^5.0.1"
@@ -10325,9 +10322,9 @@
"dev": true "dev": true
}, },
"husky": { "husky": {
"version": "7.0.2", "version": "9.1.1",
"resolved": "https://registry.npmjs.org/husky/-/husky-7.0.2.tgz", "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.1.tgz",
"integrity": "sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg==", "integrity": "sha512-fCqlqLXcBnXa/TJXmT93/A36tJsjdJkibQ1MuIiFyCCYUlpYpIaj2mv1w+3KR6Rzu1IC3slFTje5f6DUp2A2rg==",
"dev": true "dev": true
}, },
"ignore": { "ignore": {
@@ -10518,11 +10515,6 @@
"integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
"dev": true "dev": true
}, },
"is-plain-object": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q=="
},
"is-regex": { "is-regex": {
"version": "1.1.4", "version": "1.1.4",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
@@ -11576,12 +11568,12 @@
"dev": true "dev": true
}, },
"micromatch": { "micromatch": {
"version": "4.0.5", "version": "4.0.8",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
"integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
"dev": true, "dev": true,
"requires": { "requires": {
"braces": "^3.0.2", "braces": "^3.0.3",
"picomatch": "^2.3.1" "picomatch": "^2.3.1"
} }
}, },
@@ -12534,9 +12526,9 @@
} }
}, },
"undici": { "undici": {
"version": "5.26.3", "version": "5.28.5",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.26.3.tgz", "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz",
"integrity": "sha512-H7n2zmKEWgOllKkIUkLvFmsJQj062lSm3uA4EYApG8gLuiOM0/go9bIoC3HVaSnfg4xunowDE2i9p8drkXuvDw==", "integrity": "sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==",
"requires": { "requires": {
"@fastify/busboy": "^2.0.0" "@fastify/busboy": "^2.0.0"
} }

View File

@@ -1,5 +1,5 @@
{ {
"name": "github-script", "name": "@actions/github-script",
"description": "A GitHub action for executing a simple script", "description": "A GitHub action for executing a simple script",
"version": "7.0.1", "version": "7.0.1",
"author": "GitHub", "author": "GitHub",
@@ -20,7 +20,7 @@
"style:write": "run-p --continue-on-error --aggregate-output format:write lint", "style:write": "run-p --continue-on-error --aggregate-output format:write lint",
"pre-commit": "run-s style:write test build", "pre-commit": "run-s style:write test build",
"test": "jest", "test": "jest",
"prepare": "husky install" "prepare": "husky"
}, },
"jest": { "jest": {
"preset": "ts-jest", "preset": "ts-jest",
@@ -57,7 +57,7 @@
"eslint": "^8.51.0", "eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0", "eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1", "eslint-plugin-prettier": "^5.0.1",
"husky": "^7.0.0", "husky": "^9.1.1",
"jest": "^29.7.0", "jest": "^29.7.0",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"prettier": "^3.0.3", "prettier": "^3.0.3",

View File

@@ -11,6 +11,7 @@ export declare type AsyncFunctionArguments = {
context: Context context: Context
core: typeof core core: typeof core
github: InstanceType<typeof GitHub> github: InstanceType<typeof GitHub>
octokit: InstanceType<typeof GitHub>
exec: typeof exec exec: typeof exec
glob: typeof glob glob: typeof glob
io: typeof io io: typeof io

View File

@@ -62,6 +62,7 @@ async function main(): Promise<void> {
require: wrapRequire, require: wrapRequire,
__original_require__: __non_webpack_require__, __original_require__: __non_webpack_require__,
github, github,
octokit: github,
context, context,
core, core,
exec, exec,

View File

@@ -9,6 +9,7 @@ export declare type AsyncFunctionArguments = {
context: Context; context: Context;
core: typeof core; core: typeof core;
github: InstanceType<typeof GitHub>; github: InstanceType<typeof GitHub>;
octokit: InstanceType<typeof GitHub>;
exec: typeof exec; exec: typeof exec;
glob: typeof glob; glob: typeof glob;
io: typeof io; io: typeof io;