mirror of
https://github.com/actions/github-script.git
synced 2025-12-08 16:16:21 +00:00
Compare commits
70 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7906e4ad0 | ||
|
|
ea954ff83a | ||
|
|
57c10d434e | ||
|
|
eae7dc1b88 | ||
|
|
f1ab5779d6 | ||
|
|
8d9f8fc050 | ||
|
|
a4f398e58b | ||
|
|
806be26275 | ||
|
|
8d76c9a913 | ||
|
|
78f623b2da | ||
|
|
98814c53be | ||
|
|
ba6cf3fe7c | ||
|
|
bcc389184d | ||
|
|
da8818015e | ||
|
|
4d93f38890 | ||
|
|
0550e85801 | ||
|
|
5420835fff | ||
|
|
03377835c3 | ||
|
|
8c6dda0186 | ||
|
|
ee0d992b06 | ||
|
|
00be60ac26 | ||
|
|
b7f2567036 | ||
|
|
4a65b1d78b | ||
|
|
5a2006bc4f | ||
|
|
b4677cbffd | ||
|
|
f34078a491 | ||
|
|
311d596c3d | ||
|
|
7dc29a470d | ||
|
|
570fe7c5f7 | ||
|
|
454eac42ff | ||
|
|
e0306a3c1d | ||
|
|
20fcf2e7fe | ||
|
|
d556feaca3 | ||
|
|
01fde8b524 | ||
|
|
633e9fd3a1 | ||
|
|
ee124b1288 | ||
|
|
ca24d5fb29 | ||
|
|
c09747ec1a | ||
|
|
100527700e | ||
|
|
085a7754e8 | ||
|
|
6871f0ffce | ||
|
|
7ed718295b | ||
|
|
7dff1a8764 | ||
|
|
8445ca871a | ||
|
|
d4560e1570 | ||
|
|
d742690307 | ||
|
|
ac0c7cb50b | ||
|
|
eb0f407f1a | ||
|
|
6b09a22cca | ||
|
|
e7dbaf0565 | ||
|
|
3faaff918c | ||
|
|
3cca041b86 | ||
|
|
55053af80a | ||
|
|
977060a05e | ||
|
|
660d907517 | ||
|
|
355d8955d8 | ||
|
|
c713e510db | ||
|
|
fc8cad1c91 | ||
|
|
4d94eeabef | ||
|
|
b9c21f17c0 | ||
|
|
6e70142499 | ||
|
|
d50f485531 | ||
|
|
1bdf7b26a5 | ||
|
|
0a9984563e | ||
|
|
46a476b638 | ||
|
|
b682e42ddb | ||
|
|
0cc15d0960 | ||
|
|
ebee6048d8 | ||
|
|
377d38faf3 | ||
|
|
174e8122c8 |
@@ -6,8 +6,11 @@ extends:
|
||||
- plugin:@typescript-eslint/eslint-recommended
|
||||
- plugin:@typescript-eslint/recommended
|
||||
- prettier/@typescript-eslint
|
||||
parserOptions:
|
||||
project: ['tsconfig.eslint.json']
|
||||
rules:
|
||||
# '@typescript-eslint/explicit-function-return-type': 0
|
||||
'@typescript-eslint/no-use-before-define':
|
||||
- 2
|
||||
- functions: false
|
||||
'@typescript-eslint/no-unnecessary-condition': error
|
||||
|
||||
11
.github/workflows/check-dist.yml
vendored
11
.github/workflows/check-dist.yml
vendored
@@ -22,12 +22,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set Node.js 12.x
|
||||
uses: actions/setup-node@v1
|
||||
- name: Set Node.js 16.x
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 12.x
|
||||
node-version: 16.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
@@ -45,7 +46,7 @@ jobs:
|
||||
id: diff
|
||||
|
||||
# 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' }}
|
||||
with:
|
||||
name: dist
|
||||
|
||||
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -10,10 +10,10 @@ jobs:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 12
|
||||
node-version: 16
|
||||
cache: npm
|
||||
- run: npm ci
|
||||
- run: npm run style:check
|
||||
|
||||
72
.github/workflows/codeql-analysis.yml
vendored
Normal file
72
.github/workflows/codeql-analysis.yml
vendored
Normal 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
|
||||
233
.github/workflows/integration.yml
vendored
233
.github/workflows/integration.yml
vendored
@@ -8,9 +8,10 @@ on:
|
||||
|
||||
jobs:
|
||||
test-return:
|
||||
name: 'Integration test: return'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- id: output-set
|
||||
uses: ./
|
||||
with:
|
||||
@@ -18,42 +19,252 @@ jobs:
|
||||
result-encoding: string
|
||||
input-value: output
|
||||
- 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
|
||||
fi
|
||||
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
|
||||
|
||||
test-relative-require:
|
||||
name: 'Integration test: relative-path require'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- id: output-set
|
||||
- uses: actions/checkout@v3
|
||||
- id: relative-require
|
||||
uses: ./
|
||||
with:
|
||||
script: return require('./package.json').name
|
||||
result-encoding: string
|
||||
input-value: output
|
||||
- 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
|
||||
fi
|
||||
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
|
||||
|
||||
test-npm-require:
|
||||
name: 'Integration test: npm package require'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/cache@v2
|
||||
- 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: output-set
|
||||
- id: npm-require
|
||||
uses: ./
|
||||
with:
|
||||
script: return require('@actions/core/package.json').name
|
||||
result-encoding: string
|
||||
input-value: output
|
||||
- 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
|
||||
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
|
||||
|
||||
2
.github/workflows/licensed.yml
vendored
2
.github/workflows/licensed.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
name: Check licenses
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # prefer to use a full fetch for licensed workflows
|
||||
# https://github.com/jonabc/setup-licensed/releases/tag/v1.1.1
|
||||
|
||||
2
.github/workflows/pull-request-test.yml
vendored
2
.github/workflows/pull-request-test.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
pull-request-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./
|
||||
with:
|
||||
script: |
|
||||
|
||||
2
.licenses/npm/@actions/core.dep.yml
generated
2
.licenses/npm/@actions/core.dep.yml
generated
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: "@actions/core"
|
||||
version: 1.8.1
|
||||
version: 1.10.0
|
||||
type: npm
|
||||
summary: Actions core lib
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/core
|
||||
|
||||
2
.licenses/npm/@actions/github.dep.yml
generated
2
.licenses/npm/@actions/github.dep.yml
generated
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: "@actions/github"
|
||||
version: 5.0.0
|
||||
version: 5.1.1
|
||||
type: npm
|
||||
summary: Actions github lib
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/github
|
||||
|
||||
2
.licenses/npm/@actions/glob.dep.yml
generated
2
.licenses/npm/@actions/glob.dep.yml
generated
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: "@actions/glob"
|
||||
version: 0.2.0
|
||||
version: 0.3.0
|
||||
type: npm
|
||||
summary: Actions glob lib
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/glob
|
||||
|
||||
32
.licenses/npm/@actions/http-client-1.0.11.dep.yml
generated
32
.licenses/npm/@actions/http-client-1.0.11.dep.yml
generated
@@ -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: []
|
||||
32
.licenses/npm/@actions/http-client-2.0.0.dep.yml
generated
32
.licenses/npm/@actions/http-client-2.0.0.dep.yml
generated
@@ -1,32 +0,0 @@
|
||||
---
|
||||
name: "@actions/http-client"
|
||||
version: 2.0.0
|
||||
type: npm
|
||||
summary: Actions Http Client
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/http-client
|
||||
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: []
|
||||
32
.licenses/npm/@actions/http-client.dep.yml
generated
Normal file
32
.licenses/npm/@actions/http-client.dep.yml
generated
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
name: "@actions/http-client"
|
||||
version: 2.0.1
|
||||
type: npm
|
||||
summary: Actions Http Client
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/http-client
|
||||
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: []
|
||||
2
.licenses/npm/@octokit/core.dep.yml
generated
2
.licenses/npm/@octokit/core.dep.yml
generated
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: "@octokit/core"
|
||||
version: 3.5.1
|
||||
version: 3.6.0
|
||||
type: npm
|
||||
summary: Extendable client for GitHub's REST & GraphQL APIs
|
||||
homepage:
|
||||
|
||||
4
.licenses/npm/@octokit/openapi-types.dep.yml
generated
4
.licenses/npm/@octokit/openapi-types.dep.yml
generated
@@ -1,9 +1,9 @@
|
||||
---
|
||||
name: "@octokit/openapi-types"
|
||||
version: 11.2.0
|
||||
version: 12.11.0
|
||||
type: npm
|
||||
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
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
|
||||
20
.licenses/npm/@octokit/plugin-request-log.dep.yml
generated
Normal file
20
.licenses/npm/@octokit/plugin-request-log.dep.yml
generated
Normal 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: []
|
||||
@@ -1,9 +1,9 @@
|
||||
---
|
||||
name: "@octokit/plugin-rest-endpoint-methods"
|
||||
version: 5.13.0
|
||||
version: 5.16.2
|
||||
type: npm
|
||||
summary:
|
||||
homepage:
|
||||
summary: Octokit plugin adding one method for all of api.github.com REST API endpoints
|
||||
homepage:
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
|
||||
34
.licenses/npm/@octokit/plugin-retry.dep.yml
generated
Normal file
34
.licenses/npm/@octokit/plugin-retry.dep.yml
generated
Normal 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: []
|
||||
8
.licenses/npm/@octokit/request.dep.yml
generated
8
.licenses/npm/@octokit/request.dep.yml
generated
@@ -1,10 +1,10 @@
|
||||
---
|
||||
name: "@octokit/request"
|
||||
version: 5.6.1
|
||||
version: 5.6.3
|
||||
type: npm
|
||||
summary: "Send parameterized requests to GitHubâ\x80\x99s APIs with sensible defaults
|
||||
in browsers and Node"
|
||||
homepage: https://github.com/octokit/request.js#readme
|
||||
summary: Send parameterized requests to GitHub's APIs with sensible defaults in browsers
|
||||
and Node
|
||||
homepage:
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
|
||||
4
.licenses/npm/@octokit/types.dep.yml
generated
4
.licenses/npm/@octokit/types.dep.yml
generated
@@ -1,9 +1,9 @@
|
||||
---
|
||||
name: "@octokit/types"
|
||||
version: 6.34.0
|
||||
version: 6.41.0
|
||||
type: npm
|
||||
summary: Shared TypeScript definitions for Octokit projects
|
||||
homepage: https://github.com/octokit/types.ts#readme
|
||||
homepage:
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
|
||||
31
.licenses/npm/bottleneck.dep.yml
generated
Normal file
31
.licenses/npm/bottleneck.dep.yml
generated
Normal 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: []
|
||||
4
.licenses/npm/minimatch.dep.yml
generated
4
.licenses/npm/minimatch.dep.yml
generated
@@ -1,9 +1,9 @@
|
||||
---
|
||||
name: minimatch
|
||||
version: 3.0.4
|
||||
version: 3.1.2
|
||||
type: npm
|
||||
summary: a glob matcher in javascript
|
||||
homepage: https://github.com/isaacs/minimatch#readme
|
||||
homepage:
|
||||
license: isc
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
|
||||
20
.licenses/npm/uuid.dep.yml
generated
Normal file
20
.licenses/npm/uuid.dep.yml
generated
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: uuid
|
||||
version: 8.3.2
|
||||
type: npm
|
||||
summary: RFC4122 (v1, v4, and v5) UUIDs
|
||||
homepage:
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE.md
|
||||
text: |
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2010-2020 Robert Kieffer and other 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.
|
||||
notices: []
|
||||
64
README.md
64
README.md
@@ -7,9 +7,8 @@
|
||||
This action makes it easy to quickly write a script in your workflow that
|
||||
uses the GitHub API and the workflow run context.
|
||||
|
||||
In order to use this action, a `script` input is provided. The value of that
|
||||
input should be the body of an asynchronous function call. The following
|
||||
arguments will be provided:
|
||||
To use this action, provide an input named `script` that contains the body of an asynchronous function call.
|
||||
The following arguments will be provided:
|
||||
|
||||
- `github` A pre-authenticated
|
||||
[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
|
||||
- `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
|
||||
- `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
|
||||
requiring relative paths (relative to the current working directory) and
|
||||
requiring npm packages installed in the current working directory. If for
|
||||
@@ -84,6 +84,47 @@ output of a github-script step. For some workflows, string encoding is preferred
|
||||
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
|
||||
|
||||
Note that `github-token` is optional in this action, and the input is there
|
||||
@@ -257,7 +298,7 @@ jobs:
|
||||
echo-input:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
@@ -295,7 +336,7 @@ jobs:
|
||||
echo-input:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/github-script@v6
|
||||
env:
|
||||
SHA: '${{env.parentSHA}}'
|
||||
@@ -333,10 +374,10 @@ jobs:
|
||||
echo-input:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
node-version: 16
|
||||
- run: npm ci
|
||||
# or one-off:
|
||||
- run: npm install execa
|
||||
@@ -355,8 +396,11 @@ jobs:
|
||||
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') }
|
||||
export default function printStuff() {
|
||||
console.log('stuff')
|
||||
}
|
||||
```
|
||||
|
||||
```yaml
|
||||
@@ -366,7 +410,7 @@ jobs:
|
||||
print-stuff:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
|
||||
69
__test__/get-retry-options.test.ts
Normal file
69
__test__/get-retry-options.test.ts
Normal 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`
|
||||
})
|
||||
})
|
||||
12
action.yml
12
action.yml
@@ -13,16 +13,22 @@ inputs:
|
||||
default: ${{ github.token }}
|
||||
required: false
|
||||
debug:
|
||||
description: Whether to tell the GitHub client to log details of its requests
|
||||
default: false
|
||||
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: ${{ runner.debug == '1' }}
|
||||
user-agent:
|
||||
description: An optional user-agent string
|
||||
default: actions/github-script
|
||||
previews:
|
||||
description: A comma-separated list of API previews to accept
|
||||
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
|
||||
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:
|
||||
result:
|
||||
description: The return value of the script, stringified with `JSON.stringify`
|
||||
|
||||
19537
dist/index.js
vendored
19537
dist/index.js
vendored
File diff suppressed because one or more lines are too long
347
package-lock.json
generated
347
package-lock.json
generated
@@ -1,28 +1,30 @@
|
||||
{
|
||||
"name": "github-script",
|
||||
"version": "6.0.0",
|
||||
"version": "6.4.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "github-script",
|
||||
"version": "6.0.0",
|
||||
"version": "6.4.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.8.1",
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.1.0",
|
||||
"@actions/github": "^5.0.0",
|
||||
"@actions/glob": "^0.2.0",
|
||||
"@actions/glob": "^0.3.0",
|
||||
"@actions/io": "^1.1.1",
|
||||
"@octokit/core": "^3.5.1",
|
||||
"@octokit/plugin-paginate-rest": "^2.17.0",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^5.13.0"
|
||||
"@octokit/plugin-request-log": "^1.0.4",
|
||||
"@octokit/plugin-retry": "^3.0.9",
|
||||
"node-fetch": "^2.6.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.0.2",
|
||||
"@types/node-fetch": "^2.6.2",
|
||||
"@typescript-eslint/eslint-plugin": "^3.10.1",
|
||||
"@typescript-eslint/parser": "^3.10.1",
|
||||
"@vercel/ncc": "^0.23.0",
|
||||
"@vercel/ncc": "^0.36.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^6.15.0",
|
||||
"husky": "^7.0.0",
|
||||
@@ -34,18 +36,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/core": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.8.1.tgz",
|
||||
"integrity": "sha512-LuFg2O/+rRrYxrdafnqH9mx6ADszKzQAhDuEhhMQIh47tsXzWkW4wXY5zvscqJ4KDywyJX0LA0pAESPLUjZXvw==",
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
|
||||
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
||||
"dependencies": {
|
||||
"@actions/http-client": "^2.0.0"
|
||||
"@actions/http-client": "^2.0.1",
|
||||
"uuid": "^8.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/core/node_modules/@actions/http-client": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.0.tgz",
|
||||
"integrity": "sha512-fm1+OPPey5ypgStT9K8zbBhICj4J4UV/TJIHDhuWlkb8KyJaAtjcZK184dTqul0dV0nPKX97FNtDXX20BTLXSA=="
|
||||
},
|
||||
"node_modules/@actions/exec": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.0.tgz",
|
||||
@@ -55,31 +53,43 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/github": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/github/-/github-5.0.0.tgz",
|
||||
"integrity": "sha512-QvE9eAAfEsS+yOOk0cylLBIO/d6WyWIOvsxxzdrPFaud39G6BOkUwScXZn1iBzQzHyu9SBkkLSWlohDWdsasAQ==",
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@actions/github/-/github-5.1.1.tgz",
|
||||
"integrity": "sha512-Nk59rMDoJaV+mHCOJPXuvB1zIbomlKS0dmSIqPGxd0enAXBnOfn4VWF+CGtRCwXZG9Epa54tZA7VIRlJDS8A6g==",
|
||||
"dependencies": {
|
||||
"@actions/http-client": "^1.0.11",
|
||||
"@octokit/core": "^3.4.0",
|
||||
"@octokit/plugin-paginate-rest": "^2.13.3",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^5.1.1"
|
||||
"@actions/http-client": "^2.0.1",
|
||||
"@octokit/core": "^3.6.0",
|
||||
"@octokit/plugin-paginate-rest": "^2.17.0",
|
||||
"@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": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.2.0.tgz",
|
||||
"integrity": "sha512-mqE2a7I66kxcvsdwxs/filQwZsq25IfktMaviGfDB51v6Q3bvxnV7mFsZnvYtLhqGZbPxwBnH8AD3UYaOWb//w==",
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.3.0.tgz",
|
||||
"integrity": "sha512-tJP1ZhF87fd6LBnaXWlahkyvdgvsLl7WnreW1EZaC8JWjpMXmzqWzQVe/IEYslrkT9ymibVrKyJN4UMD7uQM2w==",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.6",
|
||||
"minimatch": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/http-client": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
|
||||
"integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
|
||||
"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"
|
||||
"tunnel": "^0.0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/io": {
|
||||
@@ -1065,13 +1075,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/core": {
|
||||
"version": "3.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz",
|
||||
"integrity": "sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==",
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz",
|
||||
"integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==",
|
||||
"dependencies": {
|
||||
"@octokit/auth-token": "^2.4.4",
|
||||
"@octokit/graphql": "^4.5.8",
|
||||
"@octokit/request": "^5.6.0",
|
||||
"@octokit/request": "^5.6.3",
|
||||
"@octokit/request-error": "^2.0.5",
|
||||
"@octokit/types": "^6.0.3",
|
||||
"before-after-hook": "^2.2.0",
|
||||
@@ -1099,9 +1109,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/openapi-types": {
|
||||
"version": "11.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-11.2.0.tgz",
|
||||
"integrity": "sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA=="
|
||||
"version": "12.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz",
|
||||
"integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ=="
|
||||
},
|
||||
"node_modules/@octokit/plugin-paginate-rest": {
|
||||
"version": "2.17.0",
|
||||
@@ -1114,28 +1124,33 @@
|
||||
"@octokit/core": ">=2"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/plugin-rest-endpoint-methods": {
|
||||
"version": "5.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.13.0.tgz",
|
||||
"integrity": "sha512-uJjMTkN1KaOIgNtUPMtIXDOjx6dGYysdIFhgA52x4xSadQCz3b/zJexvITDVpANnfKPW/+E0xkOvLntqMYpviA==",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^6.34.0",
|
||||
"deprecation": "^2.3.1"
|
||||
},
|
||||
"node_modules/@octokit/plugin-request-log": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz",
|
||||
"integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==",
|
||||
"peerDependencies": {
|
||||
"@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": {
|
||||
"version": "5.6.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.1.tgz",
|
||||
"integrity": "sha512-Ls2cfs1OfXaOKzkcxnqw5MR6drMA/zWX/LIS/p8Yjdz7QKTPQLMsB3R+OvoxE6XnXeXEE2X7xe4G4l4X0gRiKQ==",
|
||||
"version": "5.6.3",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz",
|
||||
"integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==",
|
||||
"dependencies": {
|
||||
"@octokit/endpoint": "^6.0.1",
|
||||
"@octokit/request-error": "^2.1.0",
|
||||
"@octokit/types": "^6.16.1",
|
||||
"is-plain-object": "^5.0.0",
|
||||
"node-fetch": "^2.6.1",
|
||||
"node-fetch": "^2.6.7",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
}
|
||||
},
|
||||
@@ -1150,11 +1165,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/types": {
|
||||
"version": "6.34.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz",
|
||||
"integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==",
|
||||
"version": "6.41.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz",
|
||||
"integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==",
|
||||
"dependencies": {
|
||||
"@octokit/openapi-types": "^11.2.0"
|
||||
"@octokit/openapi-types": "^12.11.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@sinonjs/commons": {
|
||||
@@ -1292,6 +1307,16 @@
|
||||
"integrity": "sha512-EITwVTX5B4nDjXjGeQAfXOrm+Jn+qNjDmyDRtWoD+wZsl/RDPRTFRKivs4Mt74iOFlLOrE5+Kf+p5yjyhm3+cA==",
|
||||
"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": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.1.tgz",
|
||||
@@ -1485,9 +1510,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vercel/ncc": {
|
||||
"version": "0.23.0",
|
||||
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.23.0.tgz",
|
||||
"integrity": "sha512-Fcr1qlG9t54X4X9qbo/+jr1+t5Qc6H3TgIRBXmKkF/WDs6YFulAN6ilq2Ehx38RbgIOFxaZnjlAQ50GyexnMpQ==",
|
||||
"version": "0.36.0",
|
||||
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.0.tgz",
|
||||
"integrity": "sha512-/ZTUJ/ZkRt694k7KJNimgmHjtQcRuVwsST2Z6XfYveQIuBbHR+EqkTc1jfgPkQmMyk/vtpxo3nVxe8CNuau86A==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"ncc": "dist/ncc/cli.js"
|
||||
@@ -1771,6 +1796,11 @@
|
||||
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz",
|
||||
"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": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
@@ -4472,13 +4502,10 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/json5": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz",
|
||||
"integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==",
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
|
||||
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.5"
|
||||
},
|
||||
"bin": {
|
||||
"json5": "lib/cli.js"
|
||||
},
|
||||
@@ -4700,9 +4727,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
@@ -4710,12 +4737,6 @@
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/minimist": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
||||
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
@@ -4756,17 +4777,17 @@
|
||||
"node_modules/node-fetch/node_modules/tr46": {
|
||||
"version": "0.0.3",
|
||||
"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": {
|
||||
"version": "3.0.1",
|
||||
"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": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
|
||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
||||
"dependencies": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
@@ -5376,9 +5397,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/shell-quote": {
|
||||
"version": "1.7.2",
|
||||
"resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz",
|
||||
"integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==",
|
||||
"version": "1.7.3",
|
||||
"resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz",
|
||||
"integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/signal-exit": {
|
||||
@@ -5938,6 +5959,14 @@
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "8.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||
"bin": {
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/v8-compile-cache": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz",
|
||||
@@ -6178,18 +6207,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.8.1.tgz",
|
||||
"integrity": "sha512-LuFg2O/+rRrYxrdafnqH9mx6ADszKzQAhDuEhhMQIh47tsXzWkW4wXY5zvscqJ4KDywyJX0LA0pAESPLUjZXvw==",
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
|
||||
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
||||
"requires": {
|
||||
"@actions/http-client": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/http-client": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.0.tgz",
|
||||
"integrity": "sha512-fm1+OPPey5ypgStT9K8zbBhICj4J4UV/TJIHDhuWlkb8KyJaAtjcZK184dTqul0dV0nPKX97FNtDXX20BTLXSA=="
|
||||
}
|
||||
"@actions/http-client": "^2.0.1",
|
||||
"uuid": "^8.3.2"
|
||||
}
|
||||
},
|
||||
"@actions/exec": {
|
||||
@@ -6201,31 +6224,42 @@
|
||||
}
|
||||
},
|
||||
"@actions/github": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/github/-/github-5.0.0.tgz",
|
||||
"integrity": "sha512-QvE9eAAfEsS+yOOk0cylLBIO/d6WyWIOvsxxzdrPFaud39G6BOkUwScXZn1iBzQzHyu9SBkkLSWlohDWdsasAQ==",
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@actions/github/-/github-5.1.1.tgz",
|
||||
"integrity": "sha512-Nk59rMDoJaV+mHCOJPXuvB1zIbomlKS0dmSIqPGxd0enAXBnOfn4VWF+CGtRCwXZG9Epa54tZA7VIRlJDS8A6g==",
|
||||
"requires": {
|
||||
"@actions/http-client": "^1.0.11",
|
||||
"@octokit/core": "^3.4.0",
|
||||
"@octokit/plugin-paginate-rest": "^2.13.3",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^5.1.1"
|
||||
"@actions/http-client": "^2.0.1",
|
||||
"@octokit/core": "^3.6.0",
|
||||
"@octokit/plugin-paginate-rest": "^2.17.0",
|
||||
"@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": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.2.0.tgz",
|
||||
"integrity": "sha512-mqE2a7I66kxcvsdwxs/filQwZsq25IfktMaviGfDB51v6Q3bvxnV7mFsZnvYtLhqGZbPxwBnH8AD3UYaOWb//w==",
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.3.0.tgz",
|
||||
"integrity": "sha512-tJP1ZhF87fd6LBnaXWlahkyvdgvsLl7WnreW1EZaC8JWjpMXmzqWzQVe/IEYslrkT9ymibVrKyJN4UMD7uQM2w==",
|
||||
"requires": {
|
||||
"@actions/core": "^1.2.6",
|
||||
"minimatch": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"@actions/http-client": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
|
||||
"integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
|
||||
"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"
|
||||
"tunnel": "^0.0.6"
|
||||
}
|
||||
},
|
||||
"@actions/io": {
|
||||
@@ -6991,13 +7025,13 @@
|
||||
}
|
||||
},
|
||||
"@octokit/core": {
|
||||
"version": "3.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz",
|
||||
"integrity": "sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==",
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz",
|
||||
"integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==",
|
||||
"requires": {
|
||||
"@octokit/auth-token": "^2.4.4",
|
||||
"@octokit/graphql": "^4.5.8",
|
||||
"@octokit/request": "^5.6.0",
|
||||
"@octokit/request": "^5.6.3",
|
||||
"@octokit/request-error": "^2.0.5",
|
||||
"@octokit/types": "^6.0.3",
|
||||
"before-after-hook": "^2.2.0",
|
||||
@@ -7025,9 +7059,9 @@
|
||||
}
|
||||
},
|
||||
"@octokit/openapi-types": {
|
||||
"version": "11.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-11.2.0.tgz",
|
||||
"integrity": "sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA=="
|
||||
"version": "12.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz",
|
||||
"integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ=="
|
||||
},
|
||||
"@octokit/plugin-paginate-rest": {
|
||||
"version": "2.17.0",
|
||||
@@ -7037,25 +7071,31 @@
|
||||
"@octokit/types": "^6.34.0"
|
||||
}
|
||||
},
|
||||
"@octokit/plugin-rest-endpoint-methods": {
|
||||
"version": "5.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.13.0.tgz",
|
||||
"integrity": "sha512-uJjMTkN1KaOIgNtUPMtIXDOjx6dGYysdIFhgA52x4xSadQCz3b/zJexvITDVpANnfKPW/+E0xkOvLntqMYpviA==",
|
||||
"@octokit/plugin-request-log": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz",
|
||||
"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": {
|
||||
"@octokit/types": "^6.34.0",
|
||||
"deprecation": "^2.3.1"
|
||||
"@octokit/types": "^6.0.3",
|
||||
"bottleneck": "^2.15.3"
|
||||
}
|
||||
},
|
||||
"@octokit/request": {
|
||||
"version": "5.6.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.1.tgz",
|
||||
"integrity": "sha512-Ls2cfs1OfXaOKzkcxnqw5MR6drMA/zWX/LIS/p8Yjdz7QKTPQLMsB3R+OvoxE6XnXeXEE2X7xe4G4l4X0gRiKQ==",
|
||||
"version": "5.6.3",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz",
|
||||
"integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==",
|
||||
"requires": {
|
||||
"@octokit/endpoint": "^6.0.1",
|
||||
"@octokit/request-error": "^2.1.0",
|
||||
"@octokit/types": "^6.16.1",
|
||||
"is-plain-object": "^5.0.0",
|
||||
"node-fetch": "^2.6.1",
|
||||
"node-fetch": "^2.6.7",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
}
|
||||
},
|
||||
@@ -7070,11 +7110,11 @@
|
||||
}
|
||||
},
|
||||
"@octokit/types": {
|
||||
"version": "6.34.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz",
|
||||
"integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==",
|
||||
"version": "6.41.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz",
|
||||
"integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==",
|
||||
"requires": {
|
||||
"@octokit/openapi-types": "^11.2.0"
|
||||
"@octokit/openapi-types": "^12.11.0"
|
||||
}
|
||||
},
|
||||
"@sinonjs/commons": {
|
||||
@@ -7209,6 +7249,16 @@
|
||||
"integrity": "sha512-EITwVTX5B4nDjXjGeQAfXOrm+Jn+qNjDmyDRtWoD+wZsl/RDPRTFRKivs4Mt74iOFlLOrE5+Kf+p5yjyhm3+cA==",
|
||||
"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": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.1.tgz",
|
||||
@@ -7327,9 +7377,9 @@
|
||||
}
|
||||
},
|
||||
"@vercel/ncc": {
|
||||
"version": "0.23.0",
|
||||
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.23.0.tgz",
|
||||
"integrity": "sha512-Fcr1qlG9t54X4X9qbo/+jr1+t5Qc6H3TgIRBXmKkF/WDs6YFulAN6ilq2Ehx38RbgIOFxaZnjlAQ50GyexnMpQ==",
|
||||
"version": "0.36.0",
|
||||
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.0.tgz",
|
||||
"integrity": "sha512-/ZTUJ/ZkRt694k7KJNimgmHjtQcRuVwsST2Z6XfYveQIuBbHR+EqkTc1jfgPkQmMyk/vtpxo3nVxe8CNuau86A==",
|
||||
"dev": true
|
||||
},
|
||||
"abab": {
|
||||
@@ -7543,6 +7593,11 @@
|
||||
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz",
|
||||
"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": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
@@ -9589,13 +9644,10 @@
|
||||
"dev": true
|
||||
},
|
||||
"json5": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz",
|
||||
"integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "^1.2.5"
|
||||
}
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
|
||||
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
|
||||
"dev": true
|
||||
},
|
||||
"kleur": {
|
||||
"version": "3.0.3",
|
||||
@@ -9767,19 +9819,13 @@
|
||||
"dev": true
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
||||
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
|
||||
"dev": true
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
@@ -9809,17 +9855,17 @@
|
||||
"tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
|
||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
||||
},
|
||||
"webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
|
||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
||||
},
|
||||
"whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
|
||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
||||
"requires": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
@@ -10280,9 +10326,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"shell-quote": {
|
||||
"version": "1.7.2",
|
||||
"resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz",
|
||||
"integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==",
|
||||
"version": "1.7.3",
|
||||
"resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz",
|
||||
"integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==",
|
||||
"dev": true
|
||||
},
|
||||
"signal-exit": {
|
||||
@@ -10696,6 +10742,11 @@
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"uuid": {
|
||||
"version": "8.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
|
||||
},
|
||||
"v8-compile-cache": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz",
|
||||
|
||||
14
package.json
14
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "github-script",
|
||||
"description": "A GitHub action for executing a simple script",
|
||||
"version": "6.0.0",
|
||||
"version": "6.4.0",
|
||||
"author": "GitHub",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.js",
|
||||
@@ -31,20 +31,22 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.8.1",
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.1.0",
|
||||
"@actions/github": "^5.0.0",
|
||||
"@actions/glob": "^0.2.0",
|
||||
"@actions/glob": "^0.3.0",
|
||||
"@actions/io": "^1.1.1",
|
||||
"@octokit/core": "^3.5.1",
|
||||
"@octokit/plugin-paginate-rest": "^2.17.0",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^5.13.0"
|
||||
"@octokit/plugin-request-log": "^1.0.4",
|
||||
"@octokit/plugin-retry": "^3.0.9",
|
||||
"node-fetch": "^2.6.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.0.2",
|
||||
"@types/node-fetch": "^2.6.2",
|
||||
"@typescript-eslint/eslint-plugin": "^3.10.1",
|
||||
"@typescript-eslint/parser": "^3.10.1",
|
||||
"@vercel/ncc": "^0.23.0",
|
||||
"@vercel/ncc": "^0.36.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^6.15.0",
|
||||
"husky": "^7.0.0",
|
||||
|
||||
@@ -4,6 +4,7 @@ import {Context} from '@actions/github/lib/context'
|
||||
import {GitHub} from '@actions/github/lib/utils'
|
||||
import * as glob from '@actions/glob'
|
||||
import * as io from '@actions/io'
|
||||
import fetch from 'node-fetch'
|
||||
|
||||
const AsyncFunction = Object.getPrototypeOf(async () => null).constructor
|
||||
|
||||
@@ -14,6 +15,7 @@ type AsyncFunctionArguments = {
|
||||
exec: typeof exec
|
||||
glob: typeof glob
|
||||
io: typeof io
|
||||
fetch: typeof fetch
|
||||
require: NodeRequire
|
||||
__original_require__: NodeRequire
|
||||
}
|
||||
|
||||
35
src/main.ts
35
src/main.ts
@@ -1,9 +1,15 @@
|
||||
import * as core from '@actions/core'
|
||||
import * as exec from '@actions/exec'
|
||||
import {context, getOctokit} from '@actions/github'
|
||||
import {defaults as defaultGitHubOptions} from '@actions/github/lib/utils'
|
||||
import * as glob from '@actions/glob'
|
||||
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 {RetryOptions, getRetryOptions, parseNumberArray} from './retry-options'
|
||||
import {wrapRequire} from './wrap-require'
|
||||
|
||||
process.on('unhandledRejection', handleError)
|
||||
@@ -13,20 +19,34 @@ type Options = {
|
||||
log?: Console
|
||||
userAgent?: string
|
||||
previews?: string[]
|
||||
retry?: RetryOptions
|
||||
request?: RequestRequestOptions
|
||||
}
|
||||
|
||||
async function main(): Promise<void> {
|
||||
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 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 = {}
|
||||
if (debug === 'true') opts.log = console
|
||||
if (userAgent != null) opts.userAgent = userAgent
|
||||
if (previews != null) opts.previews = previews.split(',')
|
||||
const opts: Options = {
|
||||
log: debug ? console : undefined,
|
||||
userAgent: userAgent || undefined,
|
||||
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})
|
||||
|
||||
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors.
|
||||
@@ -39,7 +59,8 @@ async function main(): Promise<void> {
|
||||
core,
|
||||
exec,
|
||||
glob,
|
||||
io
|
||||
io,
|
||||
fetch
|
||||
},
|
||||
script
|
||||
)
|
||||
|
||||
53
src/retry-options.ts
Normal file
53
src/retry-options.ts
Normal 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
4
tsconfig.eslint.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"exclude": []
|
||||
}
|
||||
Reference in New Issue
Block a user