Compare commits

..

91 Commits

Author SHA1 Message Date
Josh Gross
d7906e4ad0 Merge pull request #363 from mjpieters/auto_debug
Default debug to current runner debug state
2023-04-05 12:32:04 -04:00
Martijn Pieters
ea954ff83a Default debug to current runner debug state
When the action 'debug' input is not set, default to the current
runner debug state. This ensures that the Octokit client request logs
are included automatically when you re-run a job with debug enabled.
2023-04-05 17:26:25 +01:00
Josh Gross
57c10d434e Merge pull request #356 from mjpieters/clean_deps
Remove unused dependencies
2023-04-04 17:31:11 -04:00
Josh Gross
eae7dc1b88 Merge branch 'main' into clean_deps 2023-04-04 17:25:20 -04:00
Josh Gross
f1ab5779d6 Merge pull request #357 from mjpieters/fix_input_handling
fix input handling
2023-04-04 17:24:41 -04:00
Martijn Pieters
8d9f8fc050 Fix null handling, covered by integration tests
`core.getInput()` always returns a string, so testing for 'not null'
is always true. This then leads to previews set to an array with
a single empty string, breaking accept-header output.

Updated eslint rules should help avoid this issue in future, and new
integration tests verify that the github client configuration now
reflects the intended configuration options.
2023-04-04 22:11:47 +01:00
Martijn Pieters
a4f398e58b Remove unused dependencies
The @octokit/plugin- references are not actually (directly) used by
@action/github-script and so only serve to confuse about what exact
version of these is included in the action. The actual versions of
these plugins are set by @action/github.

Ignoring newlines, the dist/index.js file is exactly the same without
listing these dependencies in package.json.
2023-04-04 21:34:19 +01:00
Martijn Pieters
806be26275 Clean and spruce up the integration tests a bit
- Use test-specific step ids
- Remove unused input parameters
- Provide clear output on what passed or failed, including
  a step summary for each passed test.
2023-04-04 21:18:14 +01:00
Dan Rigby
8d76c9a913 Merge pull request #358 from mjpieters/request-log-plugin
Add @octokit/plugin-request-log, to produce debug output for requests
2023-04-04 13:58:39 -04:00
Martijn Pieters
78f623b2da Add @octokit/plugin-request-log, to produce debug output for requests
Without this plugin, the debug setting is, effectively, meaningless as
none of the existing plugins produce log output.

The plugin writes the request options to octokit.log.debug, and response
times as *method path - status in ...ms* to octokit.log.info.
2023-03-30 16:00:56 +01:00
Josh Gross
98814c53be Merge pull request #339 from actions/joshmgross/bump-package-version
Bump version to 6.4.0
2023-01-26 11:32:53 -05:00
Josh Gross
ba6cf3fe7c Bump version to 6.4.0 2023-01-26 11:13:37 -05:00
Josh Gross
bcc389184d Merge pull request #321 from danmichaelo/node-fetch
Add node-fetch
2023-01-26 11:11:58 -05:00
Josh Gross
da8818015e Merge main 2023-01-26 11:05:45 -05:00
Josh Gross
4d93f38890 Update dist and audit deps 2023-01-26 11:04:27 -05:00
Josh Gross
0550e85801 Merge pull request #336 from actions/joshmgross/minimatch-license
Update license for minmatch
2023-01-26 10:24:21 -05:00
Josh Gross
5420835fff Merge branch 'main' into joshmgross/minimatch-license 2023-01-26 10:20:07 -05:00
Josh Gross
03377835c3 Merge pull request #338 from actions/joshmgross/fix-dist
Regenerate `dist`
2023-01-26 10:18:09 -05:00
Josh Gross
8c6dda0186 Regenerate dist 2023-01-25 19:38:34 -05:00
Josh Gross
ee0d992b06 Use Node 16 in CI and examples 2023-01-25 19:36:14 -05:00
Josh Gross
00be60ac26 Merge pull request #306 from austinvazquez/update-github-actions-packages
Update GitHub actions packages
2023-01-25 19:26:12 -05:00
Josh Gross
b7f2567036 Update license for minmatch 2023-01-25 19:20:13 -05:00
Dan Michael O. Heggø
4a65b1d78b Re-build 2023-01-16 10:00:23 +01:00
Josh Gross
5a2006bc4f Merge pull request #313 from jongwooo/chore/use-cache-in-check-dist
Use cache in check-dist.yml
2023-01-10 14:34:10 -05:00
Josh Gross
b4677cbffd Merge pull request #320 from actions/dependabot/npm_and_yarn/minimatch-3.1.2
Bump minimatch from 3.0.4 to 3.1.2
2023-01-10 14:33:44 -05:00
Dan Michael O. Heggø
f34078a491 Make node-fetch available 2023-01-07 00:38:19 +01:00
Dan Michael O. Heggø
311d596c3d Bump ncc 2023-01-07 00:37:32 +01:00
dependabot[bot]
7dc29a470d Bump minimatch from 3.0.4 to 3.1.2
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-06 21:43:50 +00:00
Josh Gross
570fe7c5f7 Merge pull request #319 from actions/dependabot/npm_and_yarn/json5-2.2.3
Bump json5 from 2.1.3 to 2.2.3
2023-01-06 16:42:44 -05:00
dependabot[bot]
454eac42ff Bump json5 from 2.1.3 to 2.2.3
Bumps [json5](https://github.com/json5/json5) from 2.1.3 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.1.3...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-06 02:35:34 +00:00
Jongwoo Han
e0306a3c1d Use cache in check-dist.yml
Signed-off-by: jongwooo <jongwooo.han@gmail.com>
2022-12-07 00:51:52 +09:00
Austin Vazquez
20fcf2e7fe Update GitHub actions packages
Update actions/checkout, actions/setup-node, actions/cache, and
actions/upload-artifact from v2 to v3.

Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2022-10-25 21:48:09 +00:00
Josh Gross
d556feaca3 Merge pull request #300 from actions/joshmgross/v6.3.3
Update version to 6.3.3
2022-10-13 18:34:27 -04:00
Josh Gross
01fde8b524 Update version to 6.3.3 2022-10-11 17:38:18 -04:00
Josh Gross
633e9fd3a1 Merge pull request #279 from nineinchnick/update-glob
Update `@actions/glob` to 0.3.0
2022-10-11 17:37:00 -04:00
Josh Gross
ee124b1288 Update dist 2022-10-11 17:33:09 -04:00
Josh Gross
ca24d5fb29 Update @actions/glob license version 2022-10-11 17:31:09 -04:00
Josh Gross
c09747ec1a Merge branch 'main' into update-glob 2022-10-11 17:29:19 -04:00
Josh Gross
100527700e Merge pull request #299 from actions/joshmgross/v6.3.2
Bump version to 6.3.2
2022-10-11 11:43:51 -04:00
Josh Gross
085a7754e8 Bump version to 6.3.2 2022-10-11 11:18:09 -04:00
Josh Gross
6871f0ffce Merge pull request #295 from rentziass/rentziass/update-actions-core
Update @actions/core to 1.10.0
2022-10-11 11:16:19 -04:00
Francesco Renzi
7ed718295b Update @actions/core to 1.10.0 2022-10-06 11:32:55 +01:00
Josh Gross
7dff1a8764 Merge pull request #293 from luketomlinson/main
Fix overriding request options from @actions/github
2022-09-30 16:50:50 -04:00
Luke Tomlinson
8445ca871a Fix overriding request options from @actions/github 2022-09-30 15:15:18 -04:00
Josh Gross
d4560e1570 Merge pull request #288 from luketomlinson/main
Add retry plugin and related options
2022-09-26 17:50:50 -04:00
Luke Tomlinson
d742690307 6.3.0 2022-09-26 11:24:22 -04:00
Luke Tomlinson
ac0c7cb50b Core.debug 2022-09-26 11:23:56 -04:00
Luke Tomlinson
eb0f407f1a Whitespace 2022-09-23 16:30:17 -04:00
Luke Tomlinson
6b09a22cca cleanup quotes 2022-09-23 16:28:30 -04:00
Luke Tomlinson
e7dbaf0565 update action.yml 2022-09-23 16:25:00 -04:00
Luke Tomlinson
3faaff918c PR feedback 2022-09-23 16:16:31 -04:00
Luke Tomlinson
3cca041b86 Fix http-client license 2022-09-23 13:40:59 -04:00
Luke Tomlinson
55053af80a Update licenses 2022-09-23 12:16:53 -04:00
Luke Tomlinson
977060a05e Add more info to action.yml 2022-09-23 11:56:48 -04:00
Luke Tomlinson
660d907517 refactor and add tests for retry options 2022-09-23 11:45:39 -04:00
Luke Tomlinson
355d8955d8 Add retry plugin 2022-09-23 10:56:21 -04:00
Josh Gross
c713e510db Merge pull request #283 from desrosj/update/plugin-rest-endpoint-methods
Update `@octokit/plugin-rest-endpoint-methods` to version 6.x
2022-08-26 13:12:14 -04:00
Josh Gross
fc8cad1c91 Update licenses 2022-08-26 13:08:49 -04:00
Jon Desrosiers
4d94eeabef Update version in package*.json files. 2022-08-25 10:09:03 -04:00
Jon Desrosiers
b9c21f17c0 Update @octokit/plugin-rest-endpoint-methods to v6.3.0. 2022-08-19 08:45:20 -04:00
Jon Desrosiers
6e70142499 Update @octokit/plugin-rest-endpoint-methods.
This updates the dependency to the latest version within current SemVer constraints.
2022-08-18 13:50:01 -04:00
Josh Gross
d50f485531 Merge pull request #280 from cory-miller/main
Bump @actions/core to 1.9.1
2022-08-12 10:09:00 -04:00
Cory Miller
1bdf7b26a5 Bump @actions/core to 1.9.1 2022-08-11 18:35:56 -04:00
Jan Waś
0a9984563e Update @actions/glob to 0.3.0 2022-08-04 23:18:29 +02:00
Josh Gross
46a476b638 Merge pull request #269 from kevgo/patch-1
Improve grammar
2022-06-24 15:33:41 -04:00
Josh Gross
b682e42ddb Merge pull request #270 from actions/dependabot/npm_and_yarn/shell-quote-1.7.3
Bump shell-quote from 1.7.2 to 1.7.3
2022-06-24 15:33:15 -04:00
dependabot[bot]
0cc15d0960 Bump shell-quote from 1.7.2 to 1.7.3
Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.7.2 to 1.7.3.
- [Release notes](https://github.com/substack/node-shell-quote/releases)
- [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md)
- [Commits](https://github.com/substack/node-shell-quote/compare/v1.7.2...1.7.3)

---
updated-dependencies:
- dependency-name: shell-quote
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-23 03:19:34 +00:00
Kevin Goslar
ebee6048d8 Improve grammar 2022-06-22 13:35:28 -05:00
Josh Gross
377d38faf3 Merge pull request #267 from actions/joshmgross/add-codeql
Create codeql-analysis.yml
2022-06-17 17:33:17 -04:00
Josh Gross
174e8122c8 Create codeql-analysis.yml 2022-06-15 16:25:41 -04:00
Josh Gross
7a5c598405 Merge pull request #263 from smaeda-ks/update-actions-core
Update `@actions/core` to 1.8.1
2022-05-12 18:43:19 -04:00
Josh Gross
cb1c1eb6df Classify http-client licenses 2022-05-12 18:41:55 -04:00
Josh Gross
6203d71574 Update licenses 2022-05-12 18:39:12 -04:00
Shohei Maeda
19fe498d7b Update @actions/core to 1.8.1 2022-05-13 07:29:57 +09:00
Josh Gross
9bd6ae64c1 Merge pull request #254 from dlech/patch-1
README: use pull_request_target in example
2022-03-31 17:21:17 -04:00
David Lechner
e44260d768 README: use pull_request_target in example
Pull requests from forks do not have write permission, so we need to use `pull_request_target` instead of `pull_request` to enable write permission.

Fixes #42.
2022-03-30 13:19:17 -05:00
Josh Gross
05418122f5 Merge pull request #251 from actions/dependabot/npm_and_yarn/minimist-1.2.6
Bump minimist from 1.2.5 to 1.2.6
2022-03-30 11:20:01 -04:00
Josh Gross
b82abb9b60 Merge pull request #252 from josh-/add-formatting-example-readme
Update README with Markdown text formatting example
2022-03-29 11:01:09 -04:00
Josh Parnham
d965d37133 Add text formatting example to README 2022-03-27 23:55:08 +11:00
dependabot[bot]
7cf7d15108 Bump minimist from 1.2.5 to 1.2.6
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-26 06:03:59 +00:00
Josh Gross
9ac08808f9 Merge pull request #240 from actions/joshmgross/document-esm
Add an example using ESM `import`
2022-02-11 10:21:32 -05:00
Josh Gross
53cdbb4a1b Merge pull request #239 from actions/joshmgross/v6
Release version 6.0.0
2022-02-11 10:21:20 -05:00
Josh Gross
6b8d8aaad4 Merge pull request #238 from actions/joshmgross/update-actions-core
Update `@actions/core` to 1.6.0
2022-02-11 10:19:36 -05:00
Josh Gross
6689be4f99 Merge pull request #237 from actions/joshmgross/audit-fix
Update `node-fetch`
2022-02-11 10:19:26 -05:00
Josh Gross
5541733ecf Add an example using ESM import 2022-02-09 16:17:11 -05:00
Josh Gross
cd8eebf4a5 Release version 6.0.0 2022-02-09 16:05:04 -05:00
Josh Gross
72fadf4ee8 Update @actions/core to 1.6.0 2022-02-09 15:58:07 -05:00
Josh Gross
d526c0463a Update node-fetch license 2022-02-09 15:54:39 -05:00
Josh Gross
2c946f132f Run npm audit fix 2022-02-09 15:47:54 -05:00
Josh Gross
41e1ab4f53 Merge pull request #235 from thboop/patch-1
Update default runtime to node16
2022-02-09 15:46:20 -05:00
Thomas Boop
d2ed94b14f Update default runtime to node16
Node 12 has an end of life on April 30, 2022.

This PR updates the default runtime to [node16](https://github.blog/changelog/2021-12-10-github-actions-github-hosted-runners-now-run-node-js-16-by-default/), rather then node12. 

This is supported on all Actions Runners v2.285.0 or later.
2022-02-07 14:00:27 -05:00
32 changed files with 14176 additions and 12348 deletions

View File

@@ -6,8 +6,11 @@ extends:
- plugin:@typescript-eslint/eslint-recommended - plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended - plugin:@typescript-eslint/recommended
- prettier/@typescript-eslint - prettier/@typescript-eslint
parserOptions:
project: ['tsconfig.eslint.json']
rules: rules:
# '@typescript-eslint/explicit-function-return-type': 0 # '@typescript-eslint/explicit-function-return-type': 0
'@typescript-eslint/no-use-before-define': '@typescript-eslint/no-use-before-define':
- 2 - 2
- functions: false - functions: false
'@typescript-eslint/no-unnecessary-condition': error

View File

@@ -22,12 +22,13 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set Node.js 12.x - name: Set Node.js 16.x
uses: actions/setup-node@v1 uses: actions/setup-node@v3
with: with:
node-version: 12.x node-version: 16.x
cache: npm
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm ci
@@ -45,7 +46,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@v2 - uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }} if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with: with:
name: dist name: dist

View File

@@ -10,10 +10,10 @@ jobs:
ci: ci:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-node@v2 - uses: actions/setup-node@v3
with: with:
node-version: 12 node-version: 16
cache: npm cache: npm
- run: npm ci - run: npm ci
- run: npm run style:check - run: npm run style:check

72
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@@ -0,0 +1,72 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '32 12 * * 3'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# 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)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# 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
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

View File

@@ -8,9 +8,10 @@ on:
jobs: jobs:
test-return: test-return:
name: 'Integration test: return'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- id: output-set - id: output-set
uses: ./ uses: ./
with: with:
@@ -18,42 +19,252 @@ jobs:
result-encoding: string result-encoding: string
input-value: output input-value: output
- run: | - run: |
if [[ "${{steps.output-set.outputs.result}}" != "output" ]]; then echo "- Validating output is produced"
expected="output"
if [[ "${{steps.output-set.outputs.result}}" != "$expected" ]]; then
echo $'::error::\u274C' "Expected '$expected', got ${{steps.output-set.outputs.result}}"
exit 1 exit 1
fi fi
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
test-relative-require: test-relative-require:
name: 'Integration test: relative-path require'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- id: output-set - id: relative-require
uses: ./ uses: ./
with: with:
script: return require('./package.json').name script: return require('./package.json').name
result-encoding: string result-encoding: string
input-value: output
- run: | - run: |
if [[ "${{steps.output-set.outputs.result}}" != "github-script" ]]; then echo "- Validating relative require output"
if [[ "${{steps.relative-require.outputs.result}}" != "github-script" ]]; then
echo $'::error::\u274C' "Expected '$expected', got ${{steps.relative-require.outputs.result}}"
exit 1 exit 1
fi fi
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
test-npm-require: test-npm-require:
name: 'Integration test: npm package require'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: ~/.npm path: ~/.npm
key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}} key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
restore-keys: ${{runner.os}}-npm- restore-keys: ${{runner.os}}-npm-
- run: npm ci - run: npm ci
- id: output-set - id: npm-require
uses: ./ uses: ./
with: with:
script: return require('@actions/core/package.json').name script: return require('@actions/core/package.json').name
result-encoding: string result-encoding: string
input-value: output
- run: | - run: |
if [[ "${{steps.output-set.outputs.result}}" != "@actions/core" ]]; then echo "- Validating npm require output"
expected="@actions/core"
if [[ "${{steps.npm-require.outputs.result}}" != "$expected" ]]; then
echo $'::error::\u274C' "Expected '$expected', got ${{steps.npm-require.outputs.result}}"
exit 1 exit 1
fi fi
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
test-previews:
name: 'Integration test: previews option'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
restore-keys: ${{runner.os}}-npm-
- run: npm ci
- id: previews-default
name: Default previews not set
uses: ./
with:
script: |
const endpoint = github.request.endpoint
return endpoint({}).headers.accept
result-encoding: string
- id: previews-set-single
name: Previews set to a single value
uses: ./
with:
previews: foo
script: |
const endpoint = github.request.endpoint
return endpoint({}).headers.accept
result-encoding: string
- id: previews-set-multiple
name: Previews set to comma-separated list
uses: ./
with:
previews: foo,bar,baz
script: |
const endpoint = github.request.endpoint
return endpoint({}).headers.accept
result-encoding: string
- run: |
echo "- Validating previews default"
expected="application/vnd.github.v3+json"
if [[ "${{steps.previews-default.outputs.result}}" != $expected ]]; then
echo $'::error::\u274C' "Expected '$expected', got ${{steps.previews-default.outputs.result}}"
exit 1
fi
echo "- Validating previews set to a single value"
expected="application/vnd.github.foo-preview+json"
if [[ "${{steps.previews-set-single.outputs.result}}" != $expected ]]; then
echo $'::error::\u274C' "Expected '$expected', got ${{steps.previews-set-single.outputs.result}}"
exit 1
fi
echo "- Validating previews set to multiple values"
expected="application/vnd.github.foo-preview+json,application/vnd.github.bar-preview+json,application/vnd.github.baz-preview+json"
if [[ "${{steps.previews-set-multiple.outputs.result}}" != $expected ]]; then
echo $'::error::\u274C' "Expected '$expected', got ${{steps.previews-set-multiple.outputs.result}}"
exit 1
fi
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
test-user-agent:
name: 'Integration test: user-agent option'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
restore-keys: ${{runner.os}}-npm-
- run: npm ci
- id: user-agent-default
name: Default user-agent not set
uses: ./
with:
script: |
const endpoint = github.request.endpoint
return endpoint({}).headers['user-agent']
result-encoding: string
- id: user-agent-set
name: User-agent set
uses: ./
with:
user-agent: foobar
script: |
const endpoint = github.request.endpoint
return endpoint({}).headers['user-agent']
result-encoding: string
- id: user-agent-empty
name: User-agent set to an empty string
uses: ./
with:
user-agent: ''
script: |
const endpoint = github.request.endpoint
return endpoint({}).headers['user-agent']
result-encoding: string
- run: |
echo "- Validating user-agent default"
expected="actions/github-script octokit-core.js/"
if [[ "${{steps.user-agent-default.outputs.result}}" != "$expected"* ]]; then
echo $'::error::\u274C' "Expected user-agent to start with '$expected', got ${{steps.user-agent-default.outputs.result}}"
exit 1
fi
echo "- Validating user-agent set to a value"
expected="foobar octokit-core.js/"
if [[ "${{steps.user-agent-set.outputs.result}}" != "$expected"* ]]; then
echo $'::error::\u274C' "Expected user-agent to start with '$expected', got ${{steps.user-agent-set.outputs.result}}"
exit 1
fi
echo "- Validating user-agent set to an empty string"
expected="octokit-core.js/"
if [[ "${{steps.user-agent-empty.outputs.result}}" != "$expected"* ]]; then
echo $'::error::\u274C' "Expected user-agent to start with '$expected', got ${{steps.user-agent-empty.outputs.result}}"
exit 1
fi
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
test-debug:
strategy:
matrix:
environment: ['', 'debug-integration-test']
environment: ${{ matrix.environment }}
name: "Integration test: debug option (runner.debug mode ${{ matrix.environment && 'enabled' || 'disabled' }})"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
restore-keys: ${{runner.os}}-npm-
- run: npm ci
- id: debug-default
name: Default debug not set
uses: ./
with:
script: |
const log = github.log
return {
runnerDebugMode: core.isDebug(),
debug: log.debug === console.debug,
info: log.info === console.info
}
- id: debug-true
name: Debug set to true
uses: ./
with:
debug: true
script: |
const log = github.log
return {
runnerDebugMode: core.isDebug(),
debug: log.debug === console.debug,
info: log.info === console.info
}
- id: debug-false
name: Debug set to false
uses: ./
with:
debug: false
script: |
const log = github.log
return {
runnerDebugMode: core.isDebug(),
debug: log.debug === console.debug,
info: log.info === console.info
}
- id: evaluate-tests
name: Evaluate test outputs
env:
RDMODE: ${{ runner.debug == '1' }}
run: |
# tests table, pipe separated: label | output | expected
# leading and trailing spaces on any field are trimmed
tests=$(cat << 'TESTS'
Validating debug default |\
${{ steps.debug-default.outputs.result }} |\
{"runnerDebugMode":${{ env.RDMODE }},"debug":${{ env.RDMODE }},"info":${{ env.RDMODE }}}
Validating debug set to true |\
${{ steps.debug-true.outputs.result }} |\
{"runnerDebugMode":${{ env.RDMODE }},"debug":true,"info":true}
Validating debug set to false |\
${{ steps.debug-false.outputs.result }} |\
{"runnerDebugMode":${{ env.RDMODE }},"debug":false,"info":false}
TESTS
)
strim() { shopt -s extglob; lt="${1##+( )}"; echo "${lt%%+( )}"; }
while IFS='|' read label output expected; do
label="$(strim "$label")"; output="$(strim "$output")"; expected="$(strim "$expected")"
echo -n "- $label:"
if [[ "$output" != "$expected" ]]; then
echo $'\n::error::\u274C' "Expected '$expected', got '$output'"
exit 1
fi
echo $' \u2705'
done <<< "$tests"
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY

View File

@@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Check licenses name: Check licenses
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
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 # https://github.com/jonabc/setup-licensed/releases/tag/v1.1.1

View File

@@ -9,7 +9,7 @@ jobs:
pull-request-test: pull-request-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: ./ - uses: ./
with: with:
script: | script: |

View File

@@ -1,6 +1,6 @@
--- ---
name: "@actions/core" name: "@actions/core"
version: 1.9.1 version: 1.10.0
type: npm type: npm
summary: Actions core lib summary: Actions core lib
homepage: https://github.com/actions/toolkit/tree/main/packages/core homepage: https://github.com/actions/toolkit/tree/main/packages/core

View File

@@ -1,6 +1,6 @@
--- ---
name: "@actions/github" name: "@actions/github"
version: 5.0.0 version: 5.1.1
type: npm type: npm
summary: Actions github lib summary: Actions github lib
homepage: https://github.com/actions/toolkit/tree/main/packages/github homepage: https://github.com/actions/toolkit/tree/main/packages/github

View File

@@ -1,6 +1,6 @@
--- ---
name: "@actions/glob" name: "@actions/glob"
version: 0.2.0 version: 0.3.0
type: npm type: npm
summary: Actions glob lib summary: Actions glob lib
homepage: https://github.com/actions/toolkit/tree/main/packages/glob homepage: https://github.com/actions/toolkit/tree/main/packages/glob

View File

@@ -1,32 +0,0 @@
---
name: "@actions/http-client"
version: 1.0.11
type: npm
summary: Actions Http Client
homepage: https://github.com/actions/http-client#readme
license: mit
licenses:
- sources: LICENSE
text: |
Actions Http Client for Node.js
Copyright (c) GitHub, Inc.
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
notices: []

View File

@@ -1,6 +1,6 @@
--- ---
name: "@octokit/core" name: "@octokit/core"
version: 3.5.1 version: 3.6.0
type: npm type: npm
summary: Extendable client for GitHub's REST & GraphQL APIs summary: Extendable client for GitHub's REST & GraphQL APIs
homepage: homepage:

View File

@@ -1,9 +1,9 @@
--- ---
name: "@octokit/openapi-types" name: "@octokit/openapi-types"
version: 11.2.0 version: 12.11.0
type: npm type: npm
summary: Generated TypeScript definitions based on GitHub's OpenAPI spec for api.github.com summary: Generated TypeScript definitions based on GitHub's OpenAPI spec for api.github.com
homepage: https://github.com/octokit/openapi-types.ts#readme homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE

View File

@@ -0,0 +1,20 @@
---
name: "@octokit/plugin-request-token"
version: 1.0.4
type: npm
summary: GitHub API token authentication for browsers and Node.js
homepage: https://github.com/octokit/plugin-request-log.js#readme
license: mit
licenses:
- sources: LICENSE
text: |
MIT License Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- sources: README.md
text: "[MIT](LICENSE)"
notices: []

View File

@@ -1,9 +1,9 @@
--- ---
name: "@octokit/plugin-rest-endpoint-methods" name: "@octokit/plugin-rest-endpoint-methods"
version: 5.13.0 version: 5.16.2
type: npm type: npm
summary: summary: Octokit plugin adding one method for all of api.github.com REST API endpoints
homepage: homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE

View File

@@ -0,0 +1,34 @@
---
name: "@octokit/plugin-retry"
version: 3.0.9
type: npm
summary: Automatic retry plugin for octokit
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) 2018 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- sources: README.md
text: "[MIT](LICENSE)"
notices: []

View File

@@ -1,10 +1,10 @@
--- ---
name: "@octokit/request" name: "@octokit/request"
version: 5.6.1 version: 5.6.3
type: npm type: npm
summary: "Send parameterized requests to GitHubâ\x80\x99s APIs with sensible defaults summary: Send parameterized requests to GitHub's APIs with sensible defaults in browsers
in browsers and Node" and Node
homepage: https://github.com/octokit/request.js#readme homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE

View File

@@ -1,9 +1,9 @@
--- ---
name: "@octokit/types" name: "@octokit/types"
version: 6.34.0 version: 6.41.0
type: npm type: npm
summary: Shared TypeScript definitions for Octokit projects summary: Shared TypeScript definitions for Octokit projects
homepage: https://github.com/octokit/types.ts#readme homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE

31
.licenses/npm/bottleneck.dep.yml generated Normal file
View File

@@ -0,0 +1,31 @@
---
name: bottleneck
version: 2.19.5
type: npm
summary: Distributed task scheduler and rate limiter
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License (MIT)
Copyright (c) 2014 Simon Grondin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
notices: []

View File

@@ -1,9 +1,9 @@
--- ---
name: minimatch name: minimatch
version: 3.0.4 version: 3.1.2
type: npm type: npm
summary: a glob matcher in javascript summary: a glob matcher in javascript
homepage: https://github.com/isaacs/minimatch#readme homepage:
license: isc license: isc
licenses: licenses:
- sources: LICENSE - sources: LICENSE

View File

@@ -1,6 +1,6 @@
--- ---
name: node-fetch name: node-fetch
version: 2.6.5 version: 2.6.7
type: npm type: npm
summary: A light-weight module that brings window.fetch to node.js summary: A light-weight module that brings window.fetch to node.js
homepage: https://github.com/bitinn/node-fetch homepage: https://github.com/bitinn/node-fetch

129
README.md
View File

@@ -7,9 +7,8 @@
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.
In order to use this action, a `script` input is provided. The value of that To use this action, provide an input named `script` that contains the body of an asynchronous function call.
input should be the body of an asynchronous function call. The following The following arguments will be provided:
arguments will be provided:
- `github` A pre-authenticated - `github` A pre-authenticated
[octokit/rest.js](https://octokit.github.io/rest.js) client with pagination plugins [octokit/rest.js](https://octokit.github.io/rest.js) client with pagination plugins
@@ -19,6 +18,7 @@ arguments will be provided:
- `glob` A reference to the [@actions/glob](https://github.com/actions/toolkit/tree/main/packages/glob) package - `glob` A reference to the [@actions/glob](https://github.com/actions/toolkit/tree/main/packages/glob) package
- `io` A reference to the [@actions/io](https://github.com/actions/toolkit/tree/main/packages/io) package - `io` A reference to the [@actions/io](https://github.com/actions/toolkit/tree/main/packages/io) package
- `exec` A reference to the [@actions/exec](https://github.com/actions/toolkit/tree/main/packages/exec) package - `exec` A reference to the [@actions/exec](https://github.com/actions/toolkit/tree/main/packages/exec) package
- `fetch` A reference to the [node-fetch](https://github.com/node-fetch/node-fetch) package
- `require` A proxy wrapper around the normal Node.js `require` to enable - `require` A proxy wrapper around the normal Node.js `require` to enable
requiring relative paths (relative to the current working directory) and requiring relative paths (relative to the current working directory) and
requiring npm packages installed in the current working directory. If for requiring npm packages installed in the current working directory. If for
@@ -32,7 +32,15 @@ defined, so you don't have to import them (see examples below).
See [octokit/rest.js](https://octokit.github.io/rest.js/) for the API client See [octokit/rest.js](https://octokit.github.io/rest.js/) for the API client
documentation. documentation.
## Breaking changes in V5 ## Breaking Changes
### Breaking changes in V6
Version 6 of this action updated the runtime to Node 16 - https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-using-nodejs-v16
All scripts are now run with Node 16 instead of Node 12 and are affected by any breaking changes between Node 12 and 16.
### Breaking changes in V5
Version 5 of this action includes the version 5 of `@actions/github` and `@octokit/plugin-rest-endpoint-methods`. As part of this update, the Octokit context available via `github` no longer has REST methods directly. These methods are available via `github.rest.*` - https://github.com/octokit/plugin-rest-endpoint-methods.js/releases/tag/v5.0.0 Version 5 of this action includes the version 5 of `@actions/github` and `@octokit/plugin-rest-endpoint-methods`. As part of this update, the Octokit context available via `github` no longer has REST methods directly. These methods are available via `github.rest.*` - https://github.com/octokit/plugin-rest-endpoint-methods.js/releases/tag/v5.0.0
@@ -50,7 +58,7 @@ The return value of the script will be in the step's outputs under the
"result" key. "result" key.
```yaml ```yaml
- uses: actions/github-script@v5 - uses: actions/github-script@v6
id: set-result id: set-result
with: with:
script: return "Hello!" script: return "Hello!"
@@ -69,13 +77,54 @@ output of a github-script step. For some workflows, string encoding is preferred
`result-encoding` input: `result-encoding` input:
```yaml ```yaml
- uses: actions/github-script@v5 - uses: actions/github-script@v6
id: my-script id: my-script
with: with:
result-encoding: string result-encoding: string
script: return "I will be string (not JSON) encoded!" script: return "I will be string (not JSON) encoded!"
``` ```
## Retries
By default, requests made with the `github` instance will not be retried. You can configure this with the `retries` option:
```yaml
- uses: actions/github-script@v6
id: my-script
with:
result-encoding: string
retries: 3
script: |
github.rest.issues.get({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
})
```
In this example, request failures from `github.rest.issues.get()` will be retried up to 3 times.
You can also configure which status codes should be exempt from retries via the `retry-exempt-status-codes` option:
```yaml
- uses: actions/github-script@v6
id: my-script
with:
result-encoding: string
retries: 3
retry-exempt-status-codes: 400,401
script: |
github.rest.issues.get({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
})
```
By default, the following status codes will not be retried: `400, 401, 403, 404, 422` [(source)](https://github.com/octokit/plugin-retry.js/blob/9a2443746c350b3beedec35cf26e197ea318a261/src/index.ts#L14).
These retries are implemented using the [octokit/plugin-retry.js](https://github.com/octokit/plugin-retry.js) plugin. The retries use [exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff) to space out retries. ([source](https://github.com/octokit/plugin-retry.js/blob/9a2443746c350b3beedec35cf26e197ea318a261/src/error-request.ts#L13))
## Examples ## Examples
Note that `github-token` is optional in this action, and the input is there Note that `github-token` is optional in this action, and the input is there
@@ -87,7 +136,7 @@ By default, github-script will use the token provided to your workflow.
```yaml ```yaml
- name: View context attributes - name: View context attributes
uses: actions/github-script@v5 uses: actions/github-script@v6
with: with:
script: console.log(context) script: console.log(context)
``` ```
@@ -103,7 +152,7 @@ jobs:
comment: comment:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v5 - uses: actions/github-script@v6
with: with:
script: | script: |
github.rest.issues.createComment({ github.rest.issues.createComment({
@@ -125,7 +174,7 @@ jobs:
apply-label: apply-label:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v5 - uses: actions/github-script@v6
with: with:
script: | script: |
github.rest.issues.addLabels({ github.rest.issues.addLabels({
@@ -138,14 +187,16 @@ jobs:
### Welcome a first-time contributor ### Welcome a first-time contributor
You can format text in comments using the same [Markdown syntax](https://docs.github.com/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) as the GitHub web interface:
```yaml ```yaml
on: pull_request on: pull_request_target
jobs: jobs:
welcome: welcome:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v5 - uses: actions/github-script@v6
with: with:
script: | script: |
// Get a list of all issues created by the PR opener // Get a list of all issues created by the PR opener
@@ -172,7 +223,9 @@ jobs:
issue_number: context.issue.number, issue_number: context.issue.number,
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
body: 'Welcome, new contributor!' body: `**Welcome**, new contributor!
Please make sure you're read our [contributing guide](CONTRIBUTING.md) and we look forward to reviewing your Pull request shortly ✨`
}) })
``` ```
@@ -188,7 +241,7 @@ jobs:
diff: diff:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v5 - uses: actions/github-script@v6
with: with:
script: | script: |
const diff_url = context.payload.pull_request.diff_url const diff_url = context.payload.pull_request.diff_url
@@ -212,7 +265,7 @@ jobs:
list-issues: list-issues:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v5 - uses: actions/github-script@v6
with: with:
script: | script: |
const query = `query($owner:String!, $name:String!, $label:String!) { const query = `query($owner:String!, $name:String!, $label:String!) {
@@ -245,8 +298,8 @@ jobs:
echo-input: echo-input:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/github-script@v5 - uses: actions/github-script@v6
with: with:
script: | script: |
const script = require('./path/to/script.js') const script = require('./path/to/script.js')
@@ -283,8 +336,8 @@ jobs:
echo-input: echo-input:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/github-script@v5 - uses: actions/github-script@v6
env: env:
SHA: '${{env.parentSHA}}' SHA: '${{env.parentSHA}}'
with: with:
@@ -321,14 +374,14 @@ jobs:
echo-input: echo-input:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-node@v2 - uses: actions/setup-node@v3
with: with:
node-version: 14 node-version: 16
- run: npm ci - run: npm ci
# or one-off: # or one-off:
- run: npm install execa - run: npm install execa
- uses: actions/github-script@v5 - uses: actions/github-script@v6
with: with:
script: | script: |
const execa = require('execa') const execa = require('execa')
@@ -338,6 +391,34 @@ jobs:
console.log(stdout) console.log(stdout)
``` ```
### Use ESM `import`
To import an ESM file, you'll need to reference your script by an absolute path and ensure you have a `package.json` file with `"type": "module"` specified.
For a script in your repository `src/print-stuff.js`:
```js
export default function printStuff() {
console.log('stuff')
}
```
```yaml
on: push
jobs:
print-stuff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/github-script@v6
with:
script: |
const { default: printStuff } = await import('${{ github.workspace }}/src/print-stuff.js')
await printStuff()
```
### Use env as input ### Use env as input
You can set env vars to use them in your script: You can set env vars to use them in your script:
@@ -349,7 +430,7 @@ jobs:
echo-input: echo-input:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v5 - uses: actions/github-script@v6
env: env:
FIRST_NAME: Mona FIRST_NAME: Mona
LAST_NAME: Octocat LAST_NAME: Octocat
@@ -377,7 +458,7 @@ jobs:
apply-label: apply-label:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v5 - uses: actions/github-script@v6
with: with:
github-token: ${{ secrets.MY_PAT }} github-token: ${{ secrets.MY_PAT }}
script: | script: |

View File

@@ -0,0 +1,69 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import {getRetryOptions} from '../src/retry-options'
describe('getRequestOptions', () => {
test('retries disabled if retries == 0', async () => {
const [retryOptions, requestOptions] = getRetryOptions(
0,
[400, 500, 502],
[]
)
expect(retryOptions.enabled).toBe(false)
expect(retryOptions.doNotRetry).toBeFalsy()
expect(requestOptions?.retries).toBeFalsy()
})
test('properties set if retries > 0', async () => {
const [retryOptions, requestOptions] = getRetryOptions(
1,
[400, 500, 502],
[]
)
expect(retryOptions.enabled).toBe(true)
expect(retryOptions.doNotRetry).toEqual([400, 500, 502])
expect(requestOptions?.retries).toEqual(1)
})
test('properties set if retries > 0', async () => {
const [retryOptions, requestOptions] = getRetryOptions(
1,
[400, 500, 502],
[]
)
expect(retryOptions.enabled).toBe(true)
expect(retryOptions.doNotRetry).toEqual([400, 500, 502])
expect(requestOptions?.retries).toEqual(1)
})
test('retryOptions.doNotRetry not set if exemptStatusCodes isEmpty', async () => {
const [retryOptions, requestOptions] = getRetryOptions(1, [], [])
expect(retryOptions.enabled).toBe(true)
expect(retryOptions.doNotRetry).toBeUndefined()
expect(requestOptions?.retries).toEqual(1)
})
test('requestOptions does not override defaults from @actions/github', async () => {
const [retryOptions, requestOptions] = getRetryOptions(1, [], {
request: {
agent: 'default-user-agent'
},
foo: 'bar'
})
expect(retryOptions.enabled).toBe(true)
expect(retryOptions.doNotRetry).toBeUndefined()
expect(requestOptions?.retries).toEqual(1)
expect(requestOptions?.agent).toEqual('default-user-agent')
expect(requestOptions?.foo).toBeUndefined() // this should not be in the `options.request` object, but at the same level as `request`
})
})

View File

@@ -13,19 +13,25 @@ inputs:
default: ${{ github.token }} default: ${{ github.token }}
required: false required: false
debug: debug:
description: Whether to tell the GitHub client to log details of its requests description: Whether to tell the GitHub client to log details of its requests. true or false. Default is to run in debug mode when the GitHub Actions step debug logging is turned on.
default: false default: ${{ runner.debug == '1' }}
user-agent: user-agent:
description: An optional user-agent string description: An optional user-agent string
default: actions/github-script default: actions/github-script
previews: previews:
description: A comma-separated list of API previews to accept description: A comma-separated list of API previews to accept
result-encoding: result-encoding:
description: Either "string" or "json" (default "json")—how the result will be encoded description: Either "string" or "json" (default "json")—how the result will be encoded
default: json default: json
retries:
description: The number of times to retry a request
default: "0"
retry-exempt-status-codes:
description: A comma separated list of status codes that will NOT be retried e.g. "400,500". No effect unless `retries` is set
default: 400,401,403,404,422 # from https://github.com/octokit/plugin-retry.js/blob/9a2443746c350b3beedec35cf26e197ea318a261/src/index.ts#L14
outputs: outputs:
result: result:
description: The return value of the script, stringified with `JSON.stringify` description: The return value of the script, stringified with `JSON.stringify`
runs: runs:
using: node12 using: node16
main: dist/index.js main: dist/index.js

25382
dist/index.js vendored

File diff suppressed because one or more lines are too long

340
package-lock.json generated
View File

@@ -1,28 +1,30 @@
{ {
"name": "github-script", "name": "github-script",
"version": "5.2.0", "version": "6.4.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "github-script", "name": "github-script",
"version": "5.2.0", "version": "6.4.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.10.0", "@actions/core": "^1.10.0",
"@actions/exec": "^1.1.0", "@actions/exec": "^1.1.0",
"@actions/github": "^5.0.0", "@actions/github": "^5.0.0",
"@actions/glob": "^0.2.0", "@actions/glob": "^0.3.0",
"@actions/io": "^1.1.1", "@actions/io": "^1.1.1",
"@octokit/core": "^3.5.1", "@octokit/core": "^3.5.1",
"@octokit/plugin-paginate-rest": "^2.17.0", "@octokit/plugin-request-log": "^1.0.4",
"@octokit/plugin-rest-endpoint-methods": "^5.13.0" "@octokit/plugin-retry": "^3.0.9",
"node-fetch": "^2.6.7"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^27.0.2", "@types/jest": "^27.0.2",
"@types/node-fetch": "^2.6.2",
"@typescript-eslint/eslint-plugin": "^3.10.1", "@typescript-eslint/eslint-plugin": "^3.10.1",
"@typescript-eslint/parser": "^3.10.1", "@typescript-eslint/parser": "^3.10.1",
"@vercel/ncc": "^0.23.0", "@vercel/ncc": "^0.36.0",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-config-prettier": "^6.15.0", "eslint-config-prettier": "^6.15.0",
"husky": "^7.0.0", "husky": "^7.0.0",
@@ -42,14 +44,6 @@
"uuid": "^8.3.2" "uuid": "^8.3.2"
} }
}, },
"node_modules/@actions/core/node_modules/@actions/http-client": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
"dependencies": {
"tunnel": "^0.0.6"
}
},
"node_modules/@actions/exec": { "node_modules/@actions/exec": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.0.tgz",
@@ -59,31 +53,43 @@
} }
}, },
"node_modules/@actions/github": { "node_modules/@actions/github": {
"version": "5.0.0", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/@actions/github/-/github-5.0.0.tgz", "resolved": "https://registry.npmjs.org/@actions/github/-/github-5.1.1.tgz",
"integrity": "sha512-QvE9eAAfEsS+yOOk0cylLBIO/d6WyWIOvsxxzdrPFaud39G6BOkUwScXZn1iBzQzHyu9SBkkLSWlohDWdsasAQ==", "integrity": "sha512-Nk59rMDoJaV+mHCOJPXuvB1zIbomlKS0dmSIqPGxd0enAXBnOfn4VWF+CGtRCwXZG9Epa54tZA7VIRlJDS8A6g==",
"dependencies": { "dependencies": {
"@actions/http-client": "^1.0.11", "@actions/http-client": "^2.0.1",
"@octokit/core": "^3.4.0", "@octokit/core": "^3.6.0",
"@octokit/plugin-paginate-rest": "^2.13.3", "@octokit/plugin-paginate-rest": "^2.17.0",
"@octokit/plugin-rest-endpoint-methods": "^5.1.1" "@octokit/plugin-rest-endpoint-methods": "^5.13.0"
}
},
"node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods": {
"version": "5.16.2",
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.16.2.tgz",
"integrity": "sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw==",
"dependencies": {
"@octokit/types": "^6.39.0",
"deprecation": "^2.3.1"
},
"peerDependencies": {
"@octokit/core": ">=3"
} }
}, },
"node_modules/@actions/glob": { "node_modules/@actions/glob": {
"version": "0.2.0", "version": "0.3.0",
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.2.0.tgz", "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.3.0.tgz",
"integrity": "sha512-mqE2a7I66kxcvsdwxs/filQwZsq25IfktMaviGfDB51v6Q3bvxnV7mFsZnvYtLhqGZbPxwBnH8AD3UYaOWb//w==", "integrity": "sha512-tJP1ZhF87fd6LBnaXWlahkyvdgvsLl7WnreW1EZaC8JWjpMXmzqWzQVe/IEYslrkT9ymibVrKyJN4UMD7uQM2w==",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.6", "@actions/core": "^1.2.6",
"minimatch": "^3.0.4" "minimatch": "^3.0.4"
} }
}, },
"node_modules/@actions/http-client": { "node_modules/@actions/http-client": {
"version": "1.0.11", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
"integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
"dependencies": { "dependencies": {
"tunnel": "0.0.6" "tunnel": "^0.0.6"
} }
}, },
"node_modules/@actions/io": { "node_modules/@actions/io": {
@@ -1069,13 +1075,13 @@
} }
}, },
"node_modules/@octokit/core": { "node_modules/@octokit/core": {
"version": "3.5.1", "version": "3.6.0",
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz", "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz",
"integrity": "sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==", "integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==",
"dependencies": { "dependencies": {
"@octokit/auth-token": "^2.4.4", "@octokit/auth-token": "^2.4.4",
"@octokit/graphql": "^4.5.8", "@octokit/graphql": "^4.5.8",
"@octokit/request": "^5.6.0", "@octokit/request": "^5.6.3",
"@octokit/request-error": "^2.0.5", "@octokit/request-error": "^2.0.5",
"@octokit/types": "^6.0.3", "@octokit/types": "^6.0.3",
"before-after-hook": "^2.2.0", "before-after-hook": "^2.2.0",
@@ -1103,9 +1109,9 @@
} }
}, },
"node_modules/@octokit/openapi-types": { "node_modules/@octokit/openapi-types": {
"version": "11.2.0", "version": "12.11.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-11.2.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz",
"integrity": "sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA==" "integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ=="
}, },
"node_modules/@octokit/plugin-paginate-rest": { "node_modules/@octokit/plugin-paginate-rest": {
"version": "2.17.0", "version": "2.17.0",
@@ -1118,28 +1124,33 @@
"@octokit/core": ">=2" "@octokit/core": ">=2"
} }
}, },
"node_modules/@octokit/plugin-rest-endpoint-methods": { "node_modules/@octokit/plugin-request-log": {
"version": "5.13.0", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.13.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz",
"integrity": "sha512-uJjMTkN1KaOIgNtUPMtIXDOjx6dGYysdIFhgA52x4xSadQCz3b/zJexvITDVpANnfKPW/+E0xkOvLntqMYpviA==", "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==",
"dependencies": {
"@octokit/types": "^6.34.0",
"deprecation": "^2.3.1"
},
"peerDependencies": { "peerDependencies": {
"@octokit/core": ">=3" "@octokit/core": ">=3"
} }
}, },
"node_modules/@octokit/plugin-retry": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-3.0.9.tgz",
"integrity": "sha512-r+fArdP5+TG6l1Rv/C9hVoty6tldw6cE2pRHNGmFPdyfrc696R6JjrQ3d7HdVqGwuzfyrcaLAKD7K8TX8aehUQ==",
"dependencies": {
"@octokit/types": "^6.0.3",
"bottleneck": "^2.15.3"
}
},
"node_modules/@octokit/request": { "node_modules/@octokit/request": {
"version": "5.6.1", "version": "5.6.3",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.1.tgz", "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz",
"integrity": "sha512-Ls2cfs1OfXaOKzkcxnqw5MR6drMA/zWX/LIS/p8Yjdz7QKTPQLMsB3R+OvoxE6XnXeXEE2X7xe4G4l4X0gRiKQ==", "integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==",
"dependencies": { "dependencies": {
"@octokit/endpoint": "^6.0.1", "@octokit/endpoint": "^6.0.1",
"@octokit/request-error": "^2.1.0", "@octokit/request-error": "^2.1.0",
"@octokit/types": "^6.16.1", "@octokit/types": "^6.16.1",
"is-plain-object": "^5.0.0", "is-plain-object": "^5.0.0",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.7",
"universal-user-agent": "^6.0.0" "universal-user-agent": "^6.0.0"
} }
}, },
@@ -1154,11 +1165,11 @@
} }
}, },
"node_modules/@octokit/types": { "node_modules/@octokit/types": {
"version": "6.34.0", "version": "6.41.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz",
"integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==", "integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==",
"dependencies": { "dependencies": {
"@octokit/openapi-types": "^11.2.0" "@octokit/openapi-types": "^12.11.0"
} }
}, },
"node_modules/@sinonjs/commons": { "node_modules/@sinonjs/commons": {
@@ -1296,6 +1307,16 @@
"integrity": "sha512-EITwVTX5B4nDjXjGeQAfXOrm+Jn+qNjDmyDRtWoD+wZsl/RDPRTFRKivs4Mt74iOFlLOrE5+Kf+p5yjyhm3+cA==", "integrity": "sha512-EITwVTX5B4nDjXjGeQAfXOrm+Jn+qNjDmyDRtWoD+wZsl/RDPRTFRKivs4Mt74iOFlLOrE5+Kf+p5yjyhm3+cA==",
"dev": true "dev": true
}, },
"node_modules/@types/node-fetch": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz",
"integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==",
"dev": true,
"dependencies": {
"@types/node": "*",
"form-data": "^3.0.0"
}
},
"node_modules/@types/prettier": { "node_modules/@types/prettier": {
"version": "2.4.1", "version": "2.4.1",
"resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.1.tgz", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.1.tgz",
@@ -1489,9 +1510,9 @@
} }
}, },
"node_modules/@vercel/ncc": { "node_modules/@vercel/ncc": {
"version": "0.23.0", "version": "0.36.0",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.23.0.tgz", "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.0.tgz",
"integrity": "sha512-Fcr1qlG9t54X4X9qbo/+jr1+t5Qc6H3TgIRBXmKkF/WDs6YFulAN6ilq2Ehx38RbgIOFxaZnjlAQ50GyexnMpQ==", "integrity": "sha512-/ZTUJ/ZkRt694k7KJNimgmHjtQcRuVwsST2Z6XfYveQIuBbHR+EqkTc1jfgPkQmMyk/vtpxo3nVxe8CNuau86A==",
"dev": true, "dev": true,
"bin": { "bin": {
"ncc": "dist/ncc/cli.js" "ncc": "dist/ncc/cli.js"
@@ -1775,6 +1796,11 @@
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz",
"integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==" "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ=="
}, },
"node_modules/bottleneck": {
"version": "2.19.5",
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
"integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw=="
},
"node_modules/brace-expansion": { "node_modules/brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -4476,13 +4502,10 @@
"dev": true "dev": true
}, },
"node_modules/json5": { "node_modules/json5": {
"version": "2.1.3", "version": "2.2.3",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
"integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"dev": true, "dev": true,
"dependencies": {
"minimist": "^1.2.5"
},
"bin": { "bin": {
"json5": "lib/cli.js" "json5": "lib/cli.js"
}, },
@@ -4704,9 +4727,9 @@
} }
}, },
"node_modules/minimatch": { "node_modules/minimatch": {
"version": "3.0.4", "version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"dependencies": { "dependencies": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
}, },
@@ -4714,12 +4737,6 @@
"node": "*" "node": "*"
} }
}, },
"node_modules/minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"dev": true
},
"node_modules/ms": { "node_modules/ms": {
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
@@ -4739,30 +4756,38 @@
"dev": true "dev": true
}, },
"node_modules/node-fetch": { "node_modules/node-fetch": {
"version": "2.6.5", "version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==", "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"dependencies": { "dependencies": {
"whatwg-url": "^5.0.0" "whatwg-url": "^5.0.0"
}, },
"engines": { "engines": {
"node": "4.x || >=6.0.0" "node": "4.x || >=6.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
}
} }
}, },
"node_modules/node-fetch/node_modules/tr46": { "node_modules/node-fetch/node_modules/tr46": {
"version": "0.0.3", "version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
}, },
"node_modules/node-fetch/node_modules/webidl-conversions": { "node_modules/node-fetch/node_modules/webidl-conversions": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
}, },
"node_modules/node-fetch/node_modules/whatwg-url": { "node_modules/node-fetch/node_modules/whatwg-url": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
"dependencies": { "dependencies": {
"tr46": "~0.0.3", "tr46": "~0.0.3",
"webidl-conversions": "^3.0.0" "webidl-conversions": "^3.0.0"
@@ -5372,9 +5397,9 @@
} }
}, },
"node_modules/shell-quote": { "node_modules/shell-quote": {
"version": "1.7.2", "version": "1.7.3",
"resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz",
"integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==", "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==",
"dev": true "dev": true
}, },
"node_modules/signal-exit": { "node_modules/signal-exit": {
@@ -6188,16 +6213,6 @@
"requires": { "requires": {
"@actions/http-client": "^2.0.1", "@actions/http-client": "^2.0.1",
"uuid": "^8.3.2" "uuid": "^8.3.2"
},
"dependencies": {
"@actions/http-client": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
"requires": {
"tunnel": "^0.0.6"
}
}
} }
}, },
"@actions/exec": { "@actions/exec": {
@@ -6209,31 +6224,42 @@
} }
}, },
"@actions/github": { "@actions/github": {
"version": "5.0.0", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/@actions/github/-/github-5.0.0.tgz", "resolved": "https://registry.npmjs.org/@actions/github/-/github-5.1.1.tgz",
"integrity": "sha512-QvE9eAAfEsS+yOOk0cylLBIO/d6WyWIOvsxxzdrPFaud39G6BOkUwScXZn1iBzQzHyu9SBkkLSWlohDWdsasAQ==", "integrity": "sha512-Nk59rMDoJaV+mHCOJPXuvB1zIbomlKS0dmSIqPGxd0enAXBnOfn4VWF+CGtRCwXZG9Epa54tZA7VIRlJDS8A6g==",
"requires": { "requires": {
"@actions/http-client": "^1.0.11", "@actions/http-client": "^2.0.1",
"@octokit/core": "^3.4.0", "@octokit/core": "^3.6.0",
"@octokit/plugin-paginate-rest": "^2.13.3", "@octokit/plugin-paginate-rest": "^2.17.0",
"@octokit/plugin-rest-endpoint-methods": "^5.1.1" "@octokit/plugin-rest-endpoint-methods": "^5.13.0"
},
"dependencies": {
"@octokit/plugin-rest-endpoint-methods": {
"version": "5.16.2",
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.16.2.tgz",
"integrity": "sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw==",
"requires": {
"@octokit/types": "^6.39.0",
"deprecation": "^2.3.1"
}
}
} }
}, },
"@actions/glob": { "@actions/glob": {
"version": "0.2.0", "version": "0.3.0",
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.2.0.tgz", "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.3.0.tgz",
"integrity": "sha512-mqE2a7I66kxcvsdwxs/filQwZsq25IfktMaviGfDB51v6Q3bvxnV7mFsZnvYtLhqGZbPxwBnH8AD3UYaOWb//w==", "integrity": "sha512-tJP1ZhF87fd6LBnaXWlahkyvdgvsLl7WnreW1EZaC8JWjpMXmzqWzQVe/IEYslrkT9ymibVrKyJN4UMD7uQM2w==",
"requires": { "requires": {
"@actions/core": "^1.2.6", "@actions/core": "^1.2.6",
"minimatch": "^3.0.4" "minimatch": "^3.0.4"
} }
}, },
"@actions/http-client": { "@actions/http-client": {
"version": "1.0.11", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
"integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
"requires": { "requires": {
"tunnel": "0.0.6" "tunnel": "^0.0.6"
} }
}, },
"@actions/io": { "@actions/io": {
@@ -6999,13 +7025,13 @@
} }
}, },
"@octokit/core": { "@octokit/core": {
"version": "3.5.1", "version": "3.6.0",
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz", "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz",
"integrity": "sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==", "integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==",
"requires": { "requires": {
"@octokit/auth-token": "^2.4.4", "@octokit/auth-token": "^2.4.4",
"@octokit/graphql": "^4.5.8", "@octokit/graphql": "^4.5.8",
"@octokit/request": "^5.6.0", "@octokit/request": "^5.6.3",
"@octokit/request-error": "^2.0.5", "@octokit/request-error": "^2.0.5",
"@octokit/types": "^6.0.3", "@octokit/types": "^6.0.3",
"before-after-hook": "^2.2.0", "before-after-hook": "^2.2.0",
@@ -7033,9 +7059,9 @@
} }
}, },
"@octokit/openapi-types": { "@octokit/openapi-types": {
"version": "11.2.0", "version": "12.11.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-11.2.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz",
"integrity": "sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA==" "integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ=="
}, },
"@octokit/plugin-paginate-rest": { "@octokit/plugin-paginate-rest": {
"version": "2.17.0", "version": "2.17.0",
@@ -7045,25 +7071,31 @@
"@octokit/types": "^6.34.0" "@octokit/types": "^6.34.0"
} }
}, },
"@octokit/plugin-rest-endpoint-methods": { "@octokit/plugin-request-log": {
"version": "5.13.0", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.13.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz",
"integrity": "sha512-uJjMTkN1KaOIgNtUPMtIXDOjx6dGYysdIFhgA52x4xSadQCz3b/zJexvITDVpANnfKPW/+E0xkOvLntqMYpviA==", "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==",
"requires": {}
},
"@octokit/plugin-retry": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-3.0.9.tgz",
"integrity": "sha512-r+fArdP5+TG6l1Rv/C9hVoty6tldw6cE2pRHNGmFPdyfrc696R6JjrQ3d7HdVqGwuzfyrcaLAKD7K8TX8aehUQ==",
"requires": { "requires": {
"@octokit/types": "^6.34.0", "@octokit/types": "^6.0.3",
"deprecation": "^2.3.1" "bottleneck": "^2.15.3"
} }
}, },
"@octokit/request": { "@octokit/request": {
"version": "5.6.1", "version": "5.6.3",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.1.tgz", "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz",
"integrity": "sha512-Ls2cfs1OfXaOKzkcxnqw5MR6drMA/zWX/LIS/p8Yjdz7QKTPQLMsB3R+OvoxE6XnXeXEE2X7xe4G4l4X0gRiKQ==", "integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==",
"requires": { "requires": {
"@octokit/endpoint": "^6.0.1", "@octokit/endpoint": "^6.0.1",
"@octokit/request-error": "^2.1.0", "@octokit/request-error": "^2.1.0",
"@octokit/types": "^6.16.1", "@octokit/types": "^6.16.1",
"is-plain-object": "^5.0.0", "is-plain-object": "^5.0.0",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.7",
"universal-user-agent": "^6.0.0" "universal-user-agent": "^6.0.0"
} }
}, },
@@ -7078,11 +7110,11 @@
} }
}, },
"@octokit/types": { "@octokit/types": {
"version": "6.34.0", "version": "6.41.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz",
"integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==", "integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==",
"requires": { "requires": {
"@octokit/openapi-types": "^11.2.0" "@octokit/openapi-types": "^12.11.0"
} }
}, },
"@sinonjs/commons": { "@sinonjs/commons": {
@@ -7217,6 +7249,16 @@
"integrity": "sha512-EITwVTX5B4nDjXjGeQAfXOrm+Jn+qNjDmyDRtWoD+wZsl/RDPRTFRKivs4Mt74iOFlLOrE5+Kf+p5yjyhm3+cA==", "integrity": "sha512-EITwVTX5B4nDjXjGeQAfXOrm+Jn+qNjDmyDRtWoD+wZsl/RDPRTFRKivs4Mt74iOFlLOrE5+Kf+p5yjyhm3+cA==",
"dev": true "dev": true
}, },
"@types/node-fetch": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz",
"integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==",
"dev": true,
"requires": {
"@types/node": "*",
"form-data": "^3.0.0"
}
},
"@types/prettier": { "@types/prettier": {
"version": "2.4.1", "version": "2.4.1",
"resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.1.tgz", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.1.tgz",
@@ -7335,9 +7377,9 @@
} }
}, },
"@vercel/ncc": { "@vercel/ncc": {
"version": "0.23.0", "version": "0.36.0",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.23.0.tgz", "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.0.tgz",
"integrity": "sha512-Fcr1qlG9t54X4X9qbo/+jr1+t5Qc6H3TgIRBXmKkF/WDs6YFulAN6ilq2Ehx38RbgIOFxaZnjlAQ50GyexnMpQ==", "integrity": "sha512-/ZTUJ/ZkRt694k7KJNimgmHjtQcRuVwsST2Z6XfYveQIuBbHR+EqkTc1jfgPkQmMyk/vtpxo3nVxe8CNuau86A==",
"dev": true "dev": true
}, },
"abab": { "abab": {
@@ -7551,6 +7593,11 @@
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz",
"integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==" "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ=="
}, },
"bottleneck": {
"version": "2.19.5",
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
"integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw=="
},
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -9597,13 +9644,10 @@
"dev": true "dev": true
}, },
"json5": { "json5": {
"version": "2.1.3", "version": "2.2.3",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
"integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"dev": true, "dev": true
"requires": {
"minimist": "^1.2.5"
}
}, },
"kleur": { "kleur": {
"version": "3.0.3", "version": "3.0.3",
@@ -9775,19 +9819,13 @@
"dev": true "dev": true
}, },
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
}, },
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"dev": true
},
"ms": { "ms": {
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
@@ -9807,9 +9845,9 @@
"dev": true "dev": true
}, },
"node-fetch": { "node-fetch": {
"version": "2.6.5", "version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==", "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"requires": { "requires": {
"whatwg-url": "^5.0.0" "whatwg-url": "^5.0.0"
}, },
@@ -9817,17 +9855,17 @@
"tr46": { "tr46": {
"version": "0.0.3", "version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
}, },
"webidl-conversions": { "webidl-conversions": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
}, },
"whatwg-url": { "whatwg-url": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
"requires": { "requires": {
"tr46": "~0.0.3", "tr46": "~0.0.3",
"webidl-conversions": "^3.0.0" "webidl-conversions": "^3.0.0"
@@ -10288,9 +10326,9 @@
"dev": true "dev": true
}, },
"shell-quote": { "shell-quote": {
"version": "1.7.2", "version": "1.7.3",
"resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz",
"integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==", "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==",
"dev": true "dev": true
}, },
"signal-exit": { "signal-exit": {

View File

@@ -1,7 +1,7 @@
{ {
"name": "github-script", "name": "github-script",
"description": "A GitHub action for executing a simple script", "description": "A GitHub action for executing a simple script",
"version": "5.2.0", "version": "6.4.0",
"author": "GitHub", "author": "GitHub",
"license": "MIT", "license": "MIT",
"main": "dist/index.js", "main": "dist/index.js",
@@ -34,17 +34,19 @@
"@actions/core": "^1.10.0", "@actions/core": "^1.10.0",
"@actions/exec": "^1.1.0", "@actions/exec": "^1.1.0",
"@actions/github": "^5.0.0", "@actions/github": "^5.0.0",
"@actions/glob": "^0.2.0", "@actions/glob": "^0.3.0",
"@actions/io": "^1.1.1", "@actions/io": "^1.1.1",
"@octokit/core": "^3.5.1", "@octokit/core": "^3.5.1",
"@octokit/plugin-paginate-rest": "^2.17.0", "@octokit/plugin-request-log": "^1.0.4",
"@octokit/plugin-rest-endpoint-methods": "^5.13.0" "@octokit/plugin-retry": "^3.0.9",
"node-fetch": "^2.6.7"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^27.0.2", "@types/jest": "^27.0.2",
"@types/node-fetch": "^2.6.2",
"@typescript-eslint/eslint-plugin": "^3.10.1", "@typescript-eslint/eslint-plugin": "^3.10.1",
"@typescript-eslint/parser": "^3.10.1", "@typescript-eslint/parser": "^3.10.1",
"@vercel/ncc": "^0.23.0", "@vercel/ncc": "^0.36.0",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-config-prettier": "^6.15.0", "eslint-config-prettier": "^6.15.0",
"husky": "^7.0.0", "husky": "^7.0.0",
@@ -54,4 +56,4 @@
"ts-jest": "^27.0.5", "ts-jest": "^27.0.5",
"typescript": "^4.3.5" "typescript": "^4.3.5"
} }
} }

View File

@@ -4,6 +4,7 @@ import {Context} from '@actions/github/lib/context'
import {GitHub} from '@actions/github/lib/utils' import {GitHub} from '@actions/github/lib/utils'
import * as glob from '@actions/glob' import * as glob from '@actions/glob'
import * as io from '@actions/io' import * as io from '@actions/io'
import fetch from 'node-fetch'
const AsyncFunction = Object.getPrototypeOf(async () => null).constructor const AsyncFunction = Object.getPrototypeOf(async () => null).constructor
@@ -14,6 +15,7 @@ type AsyncFunctionArguments = {
exec: typeof exec exec: typeof exec
glob: typeof glob glob: typeof glob
io: typeof io io: typeof io
fetch: typeof fetch
require: NodeRequire require: NodeRequire
__original_require__: NodeRequire __original_require__: NodeRequire
} }

View File

@@ -1,9 +1,15 @@
import * as core from '@actions/core' import * as core from '@actions/core'
import * as exec from '@actions/exec' import * as exec from '@actions/exec'
import {context, getOctokit} from '@actions/github' import {context, getOctokit} from '@actions/github'
import {defaults as defaultGitHubOptions} from '@actions/github/lib/utils'
import * as glob from '@actions/glob' import * as glob from '@actions/glob'
import * as io from '@actions/io' import * as io from '@actions/io'
import {requestLog} from '@octokit/plugin-request-log'
import {retry} from '@octokit/plugin-retry'
import {RequestRequestOptions} from '@octokit/types'
import fetch from 'node-fetch'
import {callAsyncFunction} from './async-function' import {callAsyncFunction} from './async-function'
import {RetryOptions, getRetryOptions, parseNumberArray} from './retry-options'
import {wrapRequire} from './wrap-require' import {wrapRequire} from './wrap-require'
process.on('unhandledRejection', handleError) process.on('unhandledRejection', handleError)
@@ -13,20 +19,34 @@ type Options = {
log?: Console log?: Console
userAgent?: string userAgent?: string
previews?: string[] previews?: string[]
retry?: RetryOptions
request?: RequestRequestOptions
} }
async function main(): Promise<void> { async function main(): Promise<void> {
const token = core.getInput('github-token', {required: true}) const token = core.getInput('github-token', {required: true})
const debug = core.getInput('debug') const debug = core.getBooleanInput('debug')
const userAgent = core.getInput('user-agent') const userAgent = core.getInput('user-agent')
const previews = core.getInput('previews') const previews = core.getInput('previews')
const retries = parseInt(core.getInput('retries'))
const exemptStatusCodes = parseNumberArray(
core.getInput('retry-exempt-status-codes')
)
const [retryOpts, requestOpts] = getRetryOptions(
retries,
exemptStatusCodes,
defaultGitHubOptions
)
const opts: Options = {} const opts: Options = {
if (debug === 'true') opts.log = console log: debug ? console : undefined,
if (userAgent != null) opts.userAgent = userAgent userAgent: userAgent || undefined,
if (previews != null) opts.previews = previews.split(',') previews: previews ? previews.split(',') : undefined,
retry: retryOpts,
request: requestOpts
}
const github = getOctokit(token, opts) const github = getOctokit(token, opts, retry, requestLog)
const script = core.getInput('script', {required: true}) const script = core.getInput('script', {required: true})
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors. // Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors.
@@ -39,7 +59,8 @@ async function main(): Promise<void> {
core, core,
exec, exec,
glob, glob,
io io,
fetch
}, },
script script
) )

53
src/retry-options.ts Normal file
View File

@@ -0,0 +1,53 @@
import * as core from '@actions/core'
import {OctokitOptions} from '@octokit/core/dist-types/types'
import {RequestRequestOptions} from '@octokit/types'
export type RetryOptions = {
doNotRetry?: number[]
enabled?: boolean
}
export function getRetryOptions(
retries: number,
exemptStatusCodes: number[],
defaultOptions: OctokitOptions
): [RetryOptions, RequestRequestOptions | undefined] {
if (retries <= 0) {
return [{enabled: false}, defaultOptions.request]
}
const retryOptions: RetryOptions = {
enabled: true
}
if (exemptStatusCodes.length > 0) {
retryOptions.doNotRetry = exemptStatusCodes
}
// The GitHub type has some defaults for `options.request`
// see: https://github.com/actions/toolkit/blob/4fbc5c941a57249b19562015edbd72add14be93d/packages/github/src/utils.ts#L15
// We pass these in here so they are not overidden.
const requestOptions: RequestRequestOptions = {
...defaultOptions.request,
retries
}
core.debug(
`GitHub client configured with: (retries: ${
requestOptions.retries
}, retry-exempt-status-code: ${
retryOptions.doNotRetry ?? 'octokit default: [400, 401, 403, 404, 422]'
})`
)
return [retryOptions, requestOptions]
}
export function parseNumberArray(listString: string): number[] {
if (!listString) {
return []
}
const split = listString.trim().split(',')
return split.map(x => parseInt(x))
}

4
tsconfig.eslint.json Normal file
View File

@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": []
}