mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2026-02-22 16:58:06 +07:00
Compare commits
147 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afe9786629 | ||
|
|
85c1af852f | ||
|
|
fa42c49841 | ||
|
|
975798d508 | ||
|
|
af9f10cee5 | ||
|
|
6e0ef37caa | ||
|
|
5fea552c33 | ||
|
|
e1da0f2cc9 | ||
|
|
a9ca158f0a | ||
|
|
acb47d474a | ||
|
|
ffc93b5192 | ||
|
|
6e71c855c9 | ||
|
|
de27f3a58b | ||
|
|
cb8de46f10 | ||
|
|
46d151ccd7 | ||
|
|
ff6c7dc339 | ||
|
|
5f4fa74a22 | ||
|
|
b3bfbe4cf7 | ||
|
|
5d2f5abd00 | ||
|
|
bd53a4f08c | ||
|
|
a5f3b55b58 | ||
|
|
ea08c107f1 | ||
|
|
6f924fa0cf | ||
|
|
f5778250ba | ||
|
|
a78954cc59 | ||
|
|
b4a0ed8b41 | ||
|
|
6d98ae34d7 | ||
|
|
a855de38fe | ||
|
|
cb3a0635bb | ||
|
|
c2fddd52ad | ||
|
|
3ead51e1f7 | ||
|
|
1fc7d4e2c6 | ||
|
|
f196747264 | ||
|
|
2f2c447104 | ||
|
|
3b952f8862 | ||
|
|
21abe22bd8 | ||
|
|
7d23b91650 | ||
|
|
7ac0fb1e36 | ||
|
|
88cb2160ee | ||
|
|
abb4c87fd6 | ||
|
|
e04abb1cc1 | ||
|
|
c624d7739b | ||
|
|
611879133a | ||
|
|
9711b8142f | ||
|
|
5b782eef50 | ||
|
|
a3d6771524 | ||
|
|
be7681426b | ||
|
|
e27b5697b7 | ||
|
|
2cea9617b0 | ||
|
|
3c36016689 | ||
|
|
b623fcf123 | ||
|
|
2afa768d34 | ||
|
|
eaa39a13cd | ||
|
|
4226df7daa | ||
|
|
97a10a20cc | ||
|
|
9767c2af4d | ||
|
|
d6910da162 | ||
|
|
dc13c734ff | ||
|
|
48476814b0 | ||
|
|
e3f3ba4f86 | ||
|
|
19516a4a58 | ||
|
|
3c0bbc53ef | ||
|
|
6d8218d1d2 | ||
|
|
657e138a0a | ||
|
|
874d3db0a9 | ||
|
|
fa73d6accd | ||
|
|
3fceccf713 | ||
|
|
7b54875a3c | ||
|
|
f27e7f6b8d | ||
|
|
6063705cef | ||
|
|
64262eed9b | ||
|
|
118894614c | ||
|
|
07d4810b3b | ||
|
|
924d1fedb2 | ||
|
|
602f9d1725 | ||
|
|
6d23605227 | ||
|
|
f5b1987fb0 | ||
|
|
9020e79ee7 | ||
|
|
ba46013833 | ||
|
|
fd76768b61 | ||
|
|
4ef78fc181 | ||
|
|
ceb614a2c5 | ||
|
|
a1ab281c6f | ||
|
|
47d3268091 | ||
|
|
68e6c95e79 | ||
|
|
8d8aef4e43 | ||
|
|
ed3b30ffe7 | ||
|
|
b9bedb34a4 | ||
|
|
44663f34dd | ||
|
|
db36373cbe | ||
|
|
98b61f505d | ||
|
|
938c7ffae5 | ||
|
|
d892e3932a | ||
|
|
c88d504a7c | ||
|
|
16ca24fcf8 | ||
|
|
b5690f2fd6 | ||
|
|
21a68c2b95 | ||
|
|
a305c08e85 | ||
|
|
f94f0e37fa | ||
|
|
75773ecb8c | ||
|
|
63f6c7e5d2 | ||
|
|
b738850ab1 | ||
|
|
c938b3cb85 | ||
|
|
32390e9a18 | ||
|
|
b7c5d1ceb6 | ||
|
|
df34b4ded5 | ||
|
|
3ce6fdc63e | ||
|
|
f1b626cfd4 | ||
|
|
0037ae15ac | ||
|
|
5b924828c0 | ||
|
|
a2f920a18b | ||
|
|
3082f5221c | ||
|
|
9210f61cf4 | ||
|
|
a5a673e774 | ||
|
|
16840503b7 | ||
|
|
8be2ceac54 | ||
|
|
2c5f24285f | ||
|
|
2ae7800184 | ||
|
|
ee4d8deb11 | ||
|
|
0b9a55f1c6 | ||
|
|
2095e6ffe3 | ||
|
|
d1b07d9ed7 | ||
|
|
345c86e5c4 | ||
|
|
6fd4a30225 | ||
|
|
2b66ab09bf | ||
|
|
2faeb721e3 | ||
|
|
9f0c00957b | ||
|
|
1a06e16e55 | ||
|
|
3a0e152e9d | ||
|
|
c63d34f5ad | ||
|
|
a80d851dc9 | ||
|
|
37c6a4d431 | ||
|
|
edca34ffa5 | ||
|
|
4effcb0f30 | ||
|
|
72d529bf7f | ||
|
|
bd1a6a6dc3 | ||
|
|
8e479bcc5d | ||
|
|
e8b7af2f44 | ||
|
|
55c338812f | ||
|
|
73116f5945 | ||
|
|
80f113f0ef | ||
|
|
803b308fa9 | ||
|
|
586960b884 | ||
|
|
cb3cb8c8be | ||
|
|
172f2c9319 | ||
|
|
611d60b8b4 | ||
|
|
2f8c1bc14a |
16
.devcontainer/devcontainer.json
Normal file
16
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
|
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
|
||||||
|
{
|
||||||
|
"name": "Node.js & TypeScript",
|
||||||
|
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
"extensions": [
|
||||||
|
"GitHub.vscode-github-actions",
|
||||||
|
"esbenp.prettier-vscode",
|
||||||
|
"mads-hartmann.bash-ide-vscode",
|
||||||
|
"ms-azuretools.vscode-containers"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
28
.github/dependabot.yml
vendored
Normal file
28
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
time: "04:00"
|
||||||
|
pull-request-branch-name:
|
||||||
|
separator: "-"
|
||||||
|
open-pull-requests-limit: 10
|
||||||
|
ignore:
|
||||||
|
- dependency-name: nodemailer
|
||||||
|
versions:
|
||||||
|
- 6.4.18
|
||||||
|
- 6.5.0
|
||||||
|
- 6.6.0
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
time: "04:00"
|
||||||
|
pull-request-branch-name:
|
||||||
|
separator: "-"
|
||||||
|
open-pull-requests-limit: 10
|
||||||
|
- package-ecosystem: "devcontainers"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
10
.github/workflows/npm-updates.yml
vendored
Normal file
10
.github/workflows/npm-updates.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
name: NPM Updates
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
npm-updates:
|
||||||
|
uses: dawidd6/reusable-workflows/.github/workflows/npm-updates.yml@master
|
||||||
|
secrets:
|
||||||
|
personal_access_token: ${{secrets.TOKEN}}
|
||||||
70
.github/workflows/test.yml
vendored
70
.github/workflows/test.yml
vendored
@@ -1,43 +1,53 @@
|
|||||||
name: Test action
|
name: Test action
|
||||||
|
|
||||||
on: push
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
main:
|
main:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
services:
|
||||||
|
mailpit:
|
||||||
|
image: docker.io/axllent/mailpit:latest
|
||||||
|
ports:
|
||||||
|
- 1025:1025
|
||||||
|
- 8025:8025
|
||||||
strategy:
|
strategy:
|
||||||
max-parallel: 1
|
max-parallel: 1
|
||||||
matrix:
|
|
||||||
content_type:
|
|
||||||
- text/plain
|
|
||||||
- text/html
|
|
||||||
include:
|
|
||||||
- content_type: text/plain
|
|
||||||
body: file://README.md
|
|
||||||
attachments: action.yml
|
|
||||||
- content_type: text/html
|
|
||||||
body: |
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<body>
|
|
||||||
<h1>Heading</h1>
|
|
||||||
<p>Paragraph</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
attachments: package.json,package-lock.json
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Send mail
|
- name: Send mail
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
server_address: ${{secrets.ADDRESS}}
|
connection_url: smtp://localhost:1025
|
||||||
server_port: 465
|
server_address: localhost
|
||||||
username: ${{secrets.USERNAME}}
|
server_port: 1025
|
||||||
password: ${{secrets.PASSWORD}}
|
secure: false
|
||||||
subject: ${{github.repository}}
|
username: test
|
||||||
body: ${{matrix.body}}
|
password: test
|
||||||
to: ${{github.event.pusher.email}}
|
subject: Test Email
|
||||||
from: github-actions
|
to: obiwan@example.com,yoda@example.com
|
||||||
content_type: ${{matrix.content_type}}
|
from: Luke Skywalker <luke@example.com>
|
||||||
attachments: ${{matrix.attachments}}
|
body: |-
|
||||||
|
This is a test email sent from a GitHub Action.
|
||||||
|
Please check the attachments and other fields.
|
||||||
|
html_body: file://README.md
|
||||||
|
cc: leia@example.com
|
||||||
|
bcc: owen@example.com
|
||||||
|
reply_to: vader@example.com
|
||||||
|
in_reply_to: palpatine@example.com
|
||||||
|
ignore_cert: false
|
||||||
|
convert_markdown: true
|
||||||
|
attachments: package.json,action.yml
|
||||||
|
priority: high
|
||||||
|
|
||||||
|
- name: Get mail
|
||||||
|
run: |
|
||||||
|
curl -s "http://localhost:8025/api/v1/message/latest/raw"
|
||||||
|
curl -s "http://localhost:8025/api/v1/message/latest" | jq --color-output
|
||||||
|
|||||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.idea
|
||||||
82
README.md
82
README.md
@@ -1,26 +1,88 @@
|
|||||||
# Send mail Github Action
|
# Send mail GitHub Action
|
||||||
|
|
||||||
An action that simply sends a mail to multiple recipients.
|
An action that simply sends a mail to multiple recipients.
|
||||||
|
|
||||||
|
Some features:
|
||||||
|
|
||||||
|
- plain text body
|
||||||
|
- HTML body
|
||||||
|
- multipart body (plain text + HTML)
|
||||||
|
- Markdown to HTML converting (use `html_body`, not `body`)
|
||||||
|
- file attachments (supports globbing)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Send mail
|
- name: Send mail
|
||||||
uses: dawidd6/action-send-mail@v2
|
uses: dawidd6/action-send-mail@<REF>
|
||||||
|
env:
|
||||||
|
# Optional http proxy:
|
||||||
|
HTTP_PROXY: http://proxy.example.test:3128
|
||||||
with:
|
with:
|
||||||
|
# Specify connection via URL (replaces server_address, server_port, secure,
|
||||||
|
# username and password)
|
||||||
|
#
|
||||||
|
# Format:
|
||||||
|
#
|
||||||
|
# * smtp://user:password@server:port
|
||||||
|
# * smtp+starttls://user:password@server:port
|
||||||
|
connection_url: ${{secrets.MAIL_CONNECTION}}
|
||||||
|
# Required mail server address if not connection_url:
|
||||||
server_address: smtp.gmail.com
|
server_address: smtp.gmail.com
|
||||||
|
# Server port, default 25:
|
||||||
server_port: 465
|
server_port: 465
|
||||||
|
# Optional whether this connection use TLS (default is true if server_port is 465)
|
||||||
|
secure: true
|
||||||
|
# Optional (recommended) mail server username:
|
||||||
username: ${{secrets.MAIL_USERNAME}}
|
username: ${{secrets.MAIL_USERNAME}}
|
||||||
|
# Optional (recommended) mail server password:
|
||||||
password: ${{secrets.MAIL_PASSWORD}}
|
password: ${{secrets.MAIL_PASSWORD}}
|
||||||
|
# Required mail subject:
|
||||||
subject: Github Actions job result
|
subject: Github Actions job result
|
||||||
# Literal body:
|
# Required recipients' addresses:
|
||||||
body: Build job of ${{github.repository}} completed successfully!
|
to: obiwan@example.com,yoda@example.com
|
||||||
# Read file contents as body:
|
# Required sender full name (address can be skipped):
|
||||||
body: file://README.md
|
|
||||||
to: obiwan@tatooine.com,yoda@dagobah.com
|
|
||||||
from: Luke Skywalker # <user@example.com>
|
from: Luke Skywalker # <user@example.com>
|
||||||
# Optional content type (defaults to text/plain):
|
# Optional plain body:
|
||||||
content_type: text/html
|
body: Build job of ${{github.repository}} completed successfully!
|
||||||
|
# Optional HTML body read from file:
|
||||||
|
html_body: file://README.html
|
||||||
|
# Optional carbon copy recipients:
|
||||||
|
cc: kyloren@example.com,leia@example.com
|
||||||
|
# Optional blind carbon copy recipients:
|
||||||
|
bcc: r2d2@example.com,hansolo@example.com
|
||||||
|
# Optional recipient of the email response:
|
||||||
|
reply_to: luke@example.com
|
||||||
|
# Optional Message ID this message is replying to:
|
||||||
|
in_reply_to: <random-luke@example.com>
|
||||||
|
# Optional unsigned/invalid certificates allowance:
|
||||||
|
ignore_cert: true
|
||||||
|
# Optional converting Markdown to HTML (set content_type to text/html too):
|
||||||
|
convert_markdown: true
|
||||||
# Optional attachments:
|
# Optional attachments:
|
||||||
attachments: attachments.zip,git.diff,./dist/static/main.js
|
attachments: attachments.zip,git.diff,./dist/static/*.js
|
||||||
|
# Optional priority: 'high', 'normal' (default) or 'low'
|
||||||
|
priority: low
|
||||||
|
# Optional nodemailerlog: true/false
|
||||||
|
nodemailerlog: false
|
||||||
|
# Optional nodemailerdebug: true/false if true lognodem will also be set true
|
||||||
|
nodemailerdebug: false
|
||||||
|
# Optional custom SMTP MAIL FROM address (overrides username):
|
||||||
|
envelope_from: mailer@example.com
|
||||||
|
# Optional custom SMTP RCPT TO addresses (overrides to, cc, bcc):
|
||||||
|
envelope_to: mailer@example.com,admin@example.com
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### Gmail
|
||||||
|
|
||||||
|
Instead of using your normal Google password, use an App password.
|
||||||
|
|
||||||
|
1. [Enable 2-Step Verification](https://support.google.com/accounts/answer/185839?hl=en&co=GENIE.Platform%3DAndroid). This is needed to create an App password.
|
||||||
|
2. [Create an App password](https://support.google.com/accounts/answer/185833?hl=en) for `Mail`.
|
||||||
|
|
||||||
|
### Unauthenticated login (username/password fields)
|
||||||
|
|
||||||
|
The parameters `username` and `password` are set as optional to support self-hosted runners access to on-premise infrastructure. If
|
||||||
|
you are accessing public email servers make sure you provide a username/password authentication through [GitHub Secrets](https://docs.github.com/en/actions/reference/encrypted-secrets) to make the email delivery secure.
|
||||||
|
|||||||
57
action.yml
57
action.yml
@@ -5,37 +5,70 @@ branding:
|
|||||||
icon: mail
|
icon: mail
|
||||||
color: blue
|
color: blue
|
||||||
inputs:
|
inputs:
|
||||||
|
connection_url:
|
||||||
|
description: Connection URL protocol://user:password@server:port, protocol can be smtp or smtp+starttls, replaces server_address, server_port, secure, username and password
|
||||||
server_address:
|
server_address:
|
||||||
description: SMTP server address
|
description: SMTP server address
|
||||||
required: true
|
|
||||||
server_port:
|
server_port:
|
||||||
description: SMTP server port
|
description: SMTP server port
|
||||||
required: true
|
default: "25"
|
||||||
|
secure:
|
||||||
|
description: Whether this connection use TLS (default is true if server_port is 465)
|
||||||
username:
|
username:
|
||||||
description: Authenticate as this user to SMTP server
|
description: Authenticate as this user to SMTP server
|
||||||
required: true
|
|
||||||
password:
|
password:
|
||||||
description: Authenticate with this password to SMTP server
|
description: Authenticate with this password to SMTP server
|
||||||
required: true
|
|
||||||
subject:
|
subject:
|
||||||
description: Subject of mail message
|
description: Subject of mail message
|
||||||
required: true
|
required: true
|
||||||
body:
|
|
||||||
description: Body of mail message (might be a filename prefixed with file:// to read from)
|
|
||||||
required: true
|
|
||||||
to:
|
to:
|
||||||
description: Recipients mail addresses (separated with comma)
|
description: Recipients mail addresses (separated with comma)
|
||||||
required: true
|
required: false
|
||||||
from:
|
from:
|
||||||
description: Full name of mail sender (might be with an email address specified in <>)
|
description: Full name of mail sender (might be with an email address specified in <>)
|
||||||
required: true
|
required: true
|
||||||
content_type:
|
body:
|
||||||
description: Content-Type HTTP header (text/html or text/plain)
|
description: Body of mail message (might be a filename prefixed with file:// to read from)
|
||||||
|
required: false
|
||||||
|
html_body:
|
||||||
|
description: HTML body of mail message (might be a filename prefixed with file:// to read from)
|
||||||
|
required: false
|
||||||
|
cc:
|
||||||
|
description: Carbon copy recipients (separated with comma)
|
||||||
|
required: false
|
||||||
|
bcc:
|
||||||
|
description: Blind carbon copy recipients (separated with comma)
|
||||||
|
required: false
|
||||||
|
reply_to:
|
||||||
|
description: An email address that will appear on the Reply-To field
|
||||||
|
required: false
|
||||||
|
in_reply_to:
|
||||||
|
description: The Message-ID this message is replying to
|
||||||
|
required: false
|
||||||
|
ignore_cert:
|
||||||
|
description: Allow unsigned/invalid certificates
|
||||||
|
required: false
|
||||||
|
convert_markdown:
|
||||||
|
description: Convert body from Markdown to HTML (set content_type input as text/html too)
|
||||||
required: false
|
required: false
|
||||||
default: text/plain
|
|
||||||
attachments:
|
attachments:
|
||||||
description: Files that will be added to mail message attachments (separated with comma)
|
description: Files that will be added to mail message attachments (separated with comma)
|
||||||
required: false
|
required: false
|
||||||
|
priority:
|
||||||
|
description: Set Priority level for the mail message to 'high', 'normal' (default) or 'low'
|
||||||
|
required: false
|
||||||
|
nodemailerlog:
|
||||||
|
description: Log option for nodemailer
|
||||||
|
required: false
|
||||||
|
nodemailerdebug:
|
||||||
|
description: Debug option for nodemailer
|
||||||
|
required: false
|
||||||
|
envelope_from:
|
||||||
|
description: Custom envelope sender address for SMTP MAIL FROM command
|
||||||
|
required: false
|
||||||
|
envelope_to:
|
||||||
|
description: Custom envelope recipient addresses for SMTP RCPT TO command (separated with comma)
|
||||||
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: node12
|
using: node20
|
||||||
main: main.js
|
main: main.js
|
||||||
|
|||||||
229
main.js
229
main.js
@@ -1,60 +1,205 @@
|
|||||||
const nodemailer = require("nodemailer")
|
import nodemailer from "nodemailer";
|
||||||
const core = require("@actions/core")
|
import * as core from "@actions/core";
|
||||||
const fs = require("fs")
|
import * as glob from "@actions/glob";
|
||||||
|
import fs from "node:fs";
|
||||||
|
import showdown from "showdown";
|
||||||
|
import path from "node:path";
|
||||||
|
|
||||||
function get_body(body) {
|
function getText(textOrFile, convertMarkdown) {
|
||||||
if (body.startsWith("file://")) {
|
let text = textOrFile;
|
||||||
const file = body.replace("file://", "")
|
|
||||||
return fs.readFileSync(file, "utf8")
|
// Read text from file
|
||||||
|
if (textOrFile.startsWith("file://")) {
|
||||||
|
const file = textOrFile.replace("file://", "");
|
||||||
|
text = fs.readFileSync(file, "utf8");
|
||||||
}
|
}
|
||||||
|
|
||||||
return body
|
// Convert Markdown to HTML
|
||||||
|
if (convertMarkdown) {
|
||||||
|
const converter = new showdown.Converter({ tables: true });
|
||||||
|
text = converter.makeHtml(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_from(from, username) {
|
function getFrom(from, username) {
|
||||||
if (from.match(/.+<.+@.+>/)) {
|
if (from.match(/.+ <.+@.+>/)) {
|
||||||
return from
|
return from;
|
||||||
}
|
}
|
||||||
|
|
||||||
return `"${from}" <${username}>`
|
return `"${from}" <${username}>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getAttachments(attachments) {
|
||||||
|
const globber = await glob.create(attachments.split(",").join("\n"));
|
||||||
|
const files = await globber.glob();
|
||||||
|
return files.map((f) => ({
|
||||||
|
filename: path.basename(f),
|
||||||
|
path: f,
|
||||||
|
cid: f.replace(/^.*[\\\/]/, ""),
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
function sleep(ms) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
setTimeout(resolve, ms);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
try {
|
try {
|
||||||
const server_address = core.getInput("server_address", { required: true })
|
let serverAddress = core.getInput("server_address");
|
||||||
const server_port = core.getInput("server_port", { required: true })
|
let serverPort = core.getInput("server_port");
|
||||||
const username = core.getInput("username", { required: true })
|
let secure = core.getInput("secure");
|
||||||
const password = core.getInput("password", { required: true })
|
let username = core.getInput("username");
|
||||||
const subject = core.getInput("subject", { required: true })
|
let password = core.getInput("password");
|
||||||
const body = core.getInput("body", { required: true })
|
|
||||||
const to = core.getInput("to", { required: true })
|
if (!secure) {
|
||||||
const from = core.getInput("from", { required: true })
|
secure = serverPort === "465" ? "true" : "false";
|
||||||
const content_type = core.getInput("content_type", { required: true })
|
}
|
||||||
const attachments = core.getInput("attachments", { required: false })
|
|
||||||
|
const connectionUrl = core.getInput("connection_url");
|
||||||
|
if (connectionUrl) {
|
||||||
|
const url = new URL(connectionUrl);
|
||||||
|
switch (url.protocol) {
|
||||||
|
default:
|
||||||
|
throw new Error(
|
||||||
|
`Unsupported connection protocol '${url.protocol}'`
|
||||||
|
);
|
||||||
|
case "smtp:":
|
||||||
|
serverPort = "25";
|
||||||
|
secure = "false";
|
||||||
|
break;
|
||||||
|
case "smtp+starttls:":
|
||||||
|
serverPort = "465";
|
||||||
|
secure = "true";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (url.hostname) {
|
||||||
|
serverAddress = url.hostname;
|
||||||
|
}
|
||||||
|
if (url.port) {
|
||||||
|
serverPort = url.port;
|
||||||
|
}
|
||||||
|
if (url.username) {
|
||||||
|
username = unescape(url.username);
|
||||||
|
}
|
||||||
|
if (url.password) {
|
||||||
|
password = unescape(url.password);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const subject = core.getInput("subject", { required: true });
|
||||||
|
const from = core.getInput("from", { required: true });
|
||||||
|
const to = core.getInput("to", { required: false });
|
||||||
|
const body = core.getInput("body", { required: false });
|
||||||
|
const htmlBody = core.getInput("html_body", { required: false });
|
||||||
|
const cc = core.getInput("cc", { required: false });
|
||||||
|
const bcc = core.getInput("bcc", { required: false });
|
||||||
|
const replyTo = core.getInput("reply_to", { required: false });
|
||||||
|
const inReplyTo = core.getInput("in_reply_to", { required: false });
|
||||||
|
const attachments = core.getInput("attachments", { required: false });
|
||||||
|
const convertMarkdown = core.getInput("convert_markdown", {
|
||||||
|
required: false,
|
||||||
|
});
|
||||||
|
const ignoreCert = core.getInput("ignore_cert", { required: false });
|
||||||
|
const priority = core.getInput("priority", { required: false });
|
||||||
|
const nodemailerlog = core.getInput("nodemailerlog", {
|
||||||
|
required: false,
|
||||||
|
});
|
||||||
|
const nodemailerdebug = core.getInput("nodemailerdebug", {
|
||||||
|
required: false,
|
||||||
|
});
|
||||||
|
const envelopeFrom = core.getInput("envelope_from", {
|
||||||
|
required: false,
|
||||||
|
});
|
||||||
|
const envelopeTo = core.getInput("envelope_to", { required: false });
|
||||||
|
|
||||||
|
// if neither to, cc or bcc is provided, throw error
|
||||||
|
if (!to && !cc && !bcc) {
|
||||||
|
throw new Error(
|
||||||
|
"At least one of 'to', 'cc' or 'bcc' must be specified"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!serverAddress) {
|
||||||
|
throw new Error("Server address must be specified");
|
||||||
|
}
|
||||||
|
|
||||||
const transport = nodemailer.createTransport({
|
const transport = nodemailer.createTransport({
|
||||||
host: server_address,
|
host: serverAddress,
|
||||||
port: server_port,
|
auth:
|
||||||
secure: server_port == "465",
|
username && password
|
||||||
auth: {
|
? {
|
||||||
user: username,
|
user: username,
|
||||||
pass: password,
|
pass: password,
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
port: serverPort,
|
||||||
|
secure: secure === "true",
|
||||||
|
tls:
|
||||||
|
ignoreCert == "true"
|
||||||
|
? {
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
logger: nodemailerdebug == "true" ? true : nodemailerlog,
|
||||||
|
debug: nodemailerdebug,
|
||||||
|
proxy: process.env.HTTP_PROXY,
|
||||||
|
});
|
||||||
|
|
||||||
|
var i = 1;
|
||||||
|
while (true) {
|
||||||
|
try {
|
||||||
|
const info = await transport.sendMail({
|
||||||
|
from: getFrom(from, username),
|
||||||
|
to: to,
|
||||||
|
subject: getText(subject, false),
|
||||||
|
cc: cc ? cc : undefined,
|
||||||
|
bcc: bcc ? bcc : undefined,
|
||||||
|
replyTo: replyTo ? replyTo : undefined,
|
||||||
|
inReplyTo: inReplyTo ? inReplyTo : undefined,
|
||||||
|
references: inReplyTo ? inReplyTo : undefined,
|
||||||
|
text: body ? getText(body, false) : undefined,
|
||||||
|
html: htmlBody
|
||||||
|
? getText(htmlBody, convertMarkdown)
|
||||||
|
: undefined,
|
||||||
|
priority: priority ? priority : undefined,
|
||||||
|
attachments: attachments
|
||||||
|
? await getAttachments(attachments)
|
||||||
|
: undefined,
|
||||||
|
envelope:
|
||||||
|
envelopeFrom || envelopeTo
|
||||||
|
? {
|
||||||
|
from: envelopeFrom ? envelopeFrom : undefined,
|
||||||
|
to: envelopeTo ? envelopeTo : undefined,
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
} catch (error) {
|
||||||
|
if (!error.message.includes("Try again later,")) {
|
||||||
|
core.setFailed(error.message);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (i > 10) {
|
||||||
|
core.setFailed(error.message);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
console.log("Received: " + error.message);
|
||||||
|
if (i < 2) {
|
||||||
|
console.log("Trying again in a minute...");
|
||||||
|
} else {
|
||||||
|
console.log("Trying again in " + i + " minutes...");
|
||||||
|
}
|
||||||
|
await sleep(i * 60000);
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
|
||||||
const info = await transport.sendMail({
|
|
||||||
from: get_from(from, username),
|
|
||||||
to: to,
|
|
||||||
subject: subject,
|
|
||||||
text: content_type != "text/html" ? get_body(body) : undefined,
|
|
||||||
html: content_type == "text/html" ? get_body(body) : undefined,
|
|
||||||
attachments: attachments ? attachments.split(',').map(f => ({ path: f.trim() })) : undefined
|
|
||||||
})
|
|
||||||
|
|
||||||
console.log(info)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message)
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
main()
|
main();
|
||||||
|
|||||||
1
node_modules/.bin/showdown
generated
vendored
Symbolic link
1
node_modules/.bin/showdown
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../showdown/bin/showdown.js
|
||||||
386
node_modules/.package-lock.json
generated
vendored
Normal file
386
node_modules/.package-lock.json
generated
vendored
Normal file
@@ -0,0 +1,386 @@
|
|||||||
|
{
|
||||||
|
"name": "action-send-mail",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"node_modules/@actions/core": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-zYt6cz+ivnTmiT/ksRVriMBOiuoUpDCJJlZ5KPl2/FRdvwU3f7MPh9qftvbkXJThragzUZieit2nyHUyw53Seg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@actions/exec": "^3.0.0",
|
||||||
|
"@actions/http-client": "^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@actions/exec": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-6xH/puSoNBXb72VPlZVm7vQ+svQpFyA96qdDBvhB8eNZOE8LtPf9L4oAsfzK/crCL8YZ+19fKYVnM63Sl+Xzlw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@actions/io": "^3.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@actions/glob": {
|
||||||
|
"version": "0.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.6.1.tgz",
|
||||||
|
"integrity": "sha512-K4+2Ac5ILcf2ySdJCha+Pop9NcKjxqCL4xL4zI50dgB2PbXgC0+AcP011xfH4Of6b4QEJJg8dyZYv7zl4byTsw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@actions/core": "^3.0.0",
|
||||||
|
"minimatch": "^3.0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@actions/http-client": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-QuwPsgVMsD6qaPD57GLZi9sqzAZCtiJT8kVBCDpLtxhL5MydQ4gS+DrejtZZPdIYyB1e95uCK9Luyds7ybHI3g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"tunnel": "^0.0.6",
|
||||||
|
"undici": "^6.23.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@actions/io": {
|
||||||
|
"version": "3.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@actions/io/-/io-3.0.2.tgz",
|
||||||
|
"integrity": "sha512-nRBchcMM+QK1pdjO7/idu86rbJI5YHUKCvKs0KxnSYbVe3F51UfGxuZX4Qy/fWlp6l7gWFwIkrOzN+oUK03kfw==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/ansi-regex": {
|
||||||
|
"version": "4.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz",
|
||||||
|
"integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ansi-styles": {
|
||||||
|
"version": "3.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||||
|
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"color-convert": "^1.9.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/balanced-match": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/brace-expansion": {
|
||||||
|
"version": "1.1.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
|
||||||
|
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"balanced-match": "^1.0.0",
|
||||||
|
"concat-map": "0.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/camelcase": {
|
||||||
|
"version": "5.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
|
||||||
|
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/cliui": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"string-width": "^3.1.0",
|
||||||
|
"strip-ansi": "^5.2.0",
|
||||||
|
"wrap-ansi": "^5.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/color-convert": {
|
||||||
|
"version": "1.9.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
||||||
|
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"color-name": "1.1.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/color-name": {
|
||||||
|
"version": "1.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||||
|
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/concat-map": {
|
||||||
|
"version": "0.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||||
|
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/decamelize": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/emoji-regex": {
|
||||||
|
"version": "7.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
|
||||||
|
"integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/find-up": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"locate-path": "^3.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/get-caller-file": {
|
||||||
|
"version": "2.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
||||||
|
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": "6.* || 8.* || >= 10.*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/is-fullwidth-code-point": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/locate-path": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"p-locate": "^3.0.0",
|
||||||
|
"path-exists": "^3.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/minimatch": {
|
||||||
|
"version": "3.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||||
|
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"brace-expansion": "^1.1.7"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/nodemailer": {
|
||||||
|
"version": "7.0.13",
|
||||||
|
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-7.0.13.tgz",
|
||||||
|
"integrity": "sha512-PNDFSJdP+KFgdsG3ZzMXCgquO7I6McjY2vlqILjtJd0hy8wEvtugS9xKRF2NWlPNGxvLCXlTNIae4serI7dinw==",
|
||||||
|
"license": "MIT-0",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/p-limit": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
|
||||||
|
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"p-try": "^2.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/p-locate": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"p-limit": "^2.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/p-try": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/path-exists": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/require-directory": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/require-main-filename": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/set-blocking": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/showdown": {
|
||||||
|
"version": "1.9.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/showdown/-/showdown-1.9.1.tgz",
|
||||||
|
"integrity": "sha512-9cGuS382HcvExtf5AHk7Cb4pAeQQ+h0eTr33V1mu+crYWV4KvWAw6el92bDrqGEk5d46Ai/fhbEUwqJ/mTCNEA==",
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"dependencies": {
|
||||||
|
"yargs": "^14.2"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"showdown": "bin/showdown.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/string-width": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"emoji-regex": "^7.0.1",
|
||||||
|
"is-fullwidth-code-point": "^2.0.0",
|
||||||
|
"strip-ansi": "^5.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/strip-ansi": {
|
||||||
|
"version": "5.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
|
||||||
|
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": "^4.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/tunnel": {
|
||||||
|
"version": "0.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
|
||||||
|
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/undici": {
|
||||||
|
"version": "6.23.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/undici/-/undici-6.23.0.tgz",
|
||||||
|
"integrity": "sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18.17"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/which-module": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/wrap-ansi": {
|
||||||
|
"version": "5.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
|
||||||
|
"integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-styles": "^3.2.0",
|
||||||
|
"string-width": "^3.0.0",
|
||||||
|
"strip-ansi": "^5.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/y18n": {
|
||||||
|
"version": "4.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
|
||||||
|
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/yargs": {
|
||||||
|
"version": "14.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz",
|
||||||
|
"integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"cliui": "^5.0.0",
|
||||||
|
"decamelize": "^1.2.0",
|
||||||
|
"find-up": "^3.0.0",
|
||||||
|
"get-caller-file": "^2.0.1",
|
||||||
|
"require-directory": "^2.1.1",
|
||||||
|
"require-main-filename": "^2.0.0",
|
||||||
|
"set-blocking": "^2.0.0",
|
||||||
|
"string-width": "^3.0.0",
|
||||||
|
"which-module": "^2.0.0",
|
||||||
|
"y18n": "^4.0.0",
|
||||||
|
"yargs-parser": "^15.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/yargs-parser": {
|
||||||
|
"version": "15.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.3.tgz",
|
||||||
|
"integrity": "sha512-/MVEVjTXy/cGAjdtQf8dW3V9b97bPN7rNn8ETj6BmAQL7ibC7O1Q9SPJbGjgh3SlwoBNXMzj/ZGIj8mBgl12YA==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"camelcase": "^5.0.0",
|
||||||
|
"decamelize": "^1.2.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
9
node_modules/@actions/core/LICENSE.md
generated
vendored
Normal file
9
node_modules/@actions/core/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright 2019 GitHub
|
||||||
|
|
||||||
|
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.
|
||||||
350
node_modules/@actions/core/README.md
generated
vendored
350
node_modules/@actions/core/README.md
generated
vendored
@@ -16,11 +16,14 @@ import * as core from '@actions/core';
|
|||||||
|
|
||||||
#### Inputs/Outputs
|
#### Inputs/Outputs
|
||||||
|
|
||||||
Action inputs can be read with `getInput`. Outputs can be set with `setOutput` which makes them available to be mapped into inputs of other actions to ensure they are decoupled.
|
Action inputs can be read with `getInput` which returns a `string` or `getBooleanInput` which parses a boolean based on the [yaml 1.2 specification](https://yaml.org/spec/1.2/spec.html#id2804923). If `required` is set to be false, the input should have a default value in `action.yml`.
|
||||||
|
|
||||||
|
Outputs can be set with `setOutput` which makes them available to be mapped into inputs of other actions to ensure they are decoupled.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const myInput = core.getInput('inputName', { required: true });
|
const myInput = core.getInput('inputName', { required: true });
|
||||||
|
const myBooleanInput = core.getBooleanInput('booleanInputName', { required: true });
|
||||||
|
const myMultilineInput = core.getMultilineInput('multilineInputName', { required: true });
|
||||||
core.setOutput('outputKey', 'outputVal');
|
core.setOutput('outputKey', 'outputVal');
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -62,11 +65,10 @@ catch (err) {
|
|||||||
// setFailed logs the message and sets a failing exit code
|
// setFailed logs the message and sets a failing exit code
|
||||||
core.setFailed(`Action failed with error ${err}`);
|
core.setFailed(`Action failed with error ${err}`);
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
Note that `setNeutral` is not yet implemented in actions V2 but equivalent functionality is being planned.
|
Note that `setNeutral` is not yet implemented in actions V2 but equivalent functionality is being planned.
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Logging
|
#### Logging
|
||||||
|
|
||||||
Finally, this library provides some utilities for logging. Note that debug logging is hidden from the logs by default. This behavior can be toggled by enabling the [Step Debug Logs](../../docs/action-debugging.md#step-debug-logs).
|
Finally, this library provides some utilities for logging. Note that debug logging is hidden from the logs by default. This behavior can be toggled by enabling the [Step Debug Logs](../../docs/action-debugging.md#step-debug-logs).
|
||||||
@@ -89,6 +91,9 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do stuff
|
// Do stuff
|
||||||
|
core.info('Output to the actions build log')
|
||||||
|
|
||||||
|
core.notice('This is a message that will also emit an annotation')
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
core.error(`Error ${err}, action may still succeed though`);
|
core.error(`Error ${err}, action may still succeed though`);
|
||||||
@@ -112,11 +117,123 @@ const result = await core.group('Do something async', async () => {
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Annotations
|
||||||
|
|
||||||
|
This library has 3 methods that will produce [annotations](https://docs.github.com/en/rest/reference/checks#create-a-check-run).
|
||||||
|
```js
|
||||||
|
core.error('This is a bad error, action may still succeed though.')
|
||||||
|
|
||||||
|
core.warning('Something went wrong, but it\'s not bad enough to fail the build.')
|
||||||
|
|
||||||
|
core.notice('Something happened that you might want to know about.')
|
||||||
|
```
|
||||||
|
|
||||||
|
These will surface to the UI in the Actions page and on Pull Requests. They look something like this:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
These annotations can also be attached to particular lines and columns of your source files to show exactly where a problem is occuring.
|
||||||
|
|
||||||
|
These options are:
|
||||||
|
```typescript
|
||||||
|
export interface AnnotationProperties {
|
||||||
|
/**
|
||||||
|
* A title for the annotation.
|
||||||
|
*/
|
||||||
|
title?: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the file for which the annotation should be created.
|
||||||
|
*/
|
||||||
|
file?: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The start line for the annotation.
|
||||||
|
*/
|
||||||
|
startLine?: number
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The end line for the annotation. Defaults to `startLine` when `startLine` is provided.
|
||||||
|
*/
|
||||||
|
endLine?: number
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The start column for the annotation. Cannot be sent when `startLine` and `endLine` are different values.
|
||||||
|
*/
|
||||||
|
startColumn?: number
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The end column for the annotation. Cannot be sent when `startLine` and `endLine` are different values.
|
||||||
|
* Defaults to `startColumn` when `startColumn` is provided.
|
||||||
|
*/
|
||||||
|
endColumn?: number
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Styling output
|
||||||
|
|
||||||
|
Colored output is supported in the Action logs via standard [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code). 3/4 bit, 8 bit and 24 bit colors are all supported.
|
||||||
|
|
||||||
|
Foreground colors:
|
||||||
|
|
||||||
|
```js
|
||||||
|
// 3/4 bit
|
||||||
|
core.info('\u001b[35mThis foreground will be magenta')
|
||||||
|
|
||||||
|
// 8 bit
|
||||||
|
core.info('\u001b[38;5;6mThis foreground will be cyan')
|
||||||
|
|
||||||
|
// 24 bit
|
||||||
|
core.info('\u001b[38;2;255;0;0mThis foreground will be bright red')
|
||||||
|
```
|
||||||
|
|
||||||
|
Background colors:
|
||||||
|
|
||||||
|
```js
|
||||||
|
// 3/4 bit
|
||||||
|
core.info('\u001b[43mThis background will be yellow');
|
||||||
|
|
||||||
|
// 8 bit
|
||||||
|
core.info('\u001b[48;5;6mThis background will be cyan')
|
||||||
|
|
||||||
|
// 24 bit
|
||||||
|
core.info('\u001b[48;2;255;0;0mThis background will be bright red')
|
||||||
|
```
|
||||||
|
|
||||||
|
Special styles:
|
||||||
|
|
||||||
|
```js
|
||||||
|
core.info('\u001b[1mBold text')
|
||||||
|
core.info('\u001b[3mItalic text')
|
||||||
|
core.info('\u001b[4mUnderlined text')
|
||||||
|
```
|
||||||
|
|
||||||
|
ANSI escape codes can be combined with one another:
|
||||||
|
|
||||||
|
```js
|
||||||
|
core.info('\u001b[31;46mRed foreground with a cyan background and \u001b[1mbold text at the end');
|
||||||
|
```
|
||||||
|
|
||||||
|
> Note: Escape codes reset at the start of each line
|
||||||
|
|
||||||
|
```js
|
||||||
|
core.info('\u001b[35mThis foreground will be magenta')
|
||||||
|
core.info('This foreground will reset to the default')
|
||||||
|
```
|
||||||
|
|
||||||
|
Manually typing escape codes can be a little difficult, but you can use third party modules such as [ansi-styles](https://github.com/chalk/ansi-styles).
|
||||||
|
|
||||||
|
```js
|
||||||
|
const style = require('ansi-styles');
|
||||||
|
core.info(style.color.ansi16m.hex('#abcdef') + 'Hello world!')
|
||||||
|
```
|
||||||
|
|
||||||
#### Action state
|
#### Action state
|
||||||
|
|
||||||
You can use this library to save state and get state for sharing information between a given wrapper action:
|
You can use this library to save state and get state for sharing information between a given wrapper action:
|
||||||
|
|
||||||
**action.yml**
|
**action.yml**:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: 'Wrapper action sample'
|
name: 'Wrapper action sample'
|
||||||
inputs:
|
inputs:
|
||||||
@@ -137,6 +254,7 @@ core.saveState("pidToKill", 12345);
|
|||||||
```
|
```
|
||||||
|
|
||||||
In action's `cleanup.js`:
|
In action's `cleanup.js`:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const core = require('@actions/core');
|
const core = require('@actions/core');
|
||||||
|
|
||||||
@@ -144,3 +262,225 @@ var pid = core.getState("pidToKill");
|
|||||||
|
|
||||||
process.kill(pid);
|
process.kill(pid);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### OIDC Token
|
||||||
|
|
||||||
|
You can use these methods to interact with the GitHub OIDC provider and get a JWT ID token which would help to get access token from third party cloud providers.
|
||||||
|
|
||||||
|
**Method Name**: getIDToken()
|
||||||
|
|
||||||
|
**Inputs**
|
||||||
|
|
||||||
|
audience : optional
|
||||||
|
|
||||||
|
**Outputs**
|
||||||
|
|
||||||
|
A [JWT](https://jwt.io/) ID Token
|
||||||
|
|
||||||
|
In action's `main.ts`:
|
||||||
|
```js
|
||||||
|
const core = require('@actions/core');
|
||||||
|
async function getIDTokenAction(): Promise<void> {
|
||||||
|
|
||||||
|
const audience = core.getInput('audience', {required: false})
|
||||||
|
|
||||||
|
const id_token1 = await core.getIDToken() // ID Token with default audience
|
||||||
|
const id_token2 = await core.getIDToken(audience) // ID token with custom audience
|
||||||
|
|
||||||
|
// this id_token can be used to get access token from third party cloud providers
|
||||||
|
}
|
||||||
|
getIDTokenAction()
|
||||||
|
```
|
||||||
|
|
||||||
|
In action's `actions.yml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: 'GetIDToken'
|
||||||
|
description: 'Get ID token from Github OIDC provider'
|
||||||
|
inputs:
|
||||||
|
audience:
|
||||||
|
description: 'Audience for which the ID token is intended for'
|
||||||
|
required: false
|
||||||
|
outputs:
|
||||||
|
id_token1:
|
||||||
|
description: 'ID token obtained from OIDC provider'
|
||||||
|
id_token2:
|
||||||
|
description: 'ID token obtained from OIDC provider'
|
||||||
|
runs:
|
||||||
|
using: 'node12'
|
||||||
|
main: 'dist/index.js'
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Filesystem path helpers
|
||||||
|
|
||||||
|
You can use these methods to manipulate file paths across operating systems.
|
||||||
|
|
||||||
|
The `toPosixPath` function converts input paths to Posix-style (Linux) paths.
|
||||||
|
The `toWin32Path` function converts input paths to Windows-style paths. These
|
||||||
|
functions work independently of the underlying runner operating system.
|
||||||
|
|
||||||
|
```js
|
||||||
|
toPosixPath('\\foo\\bar') // => /foo/bar
|
||||||
|
toWin32Path('/foo/bar') // => \foo\bar
|
||||||
|
```
|
||||||
|
|
||||||
|
The `toPlatformPath` function converts input paths to the expected value on the runner's operating system.
|
||||||
|
|
||||||
|
```js
|
||||||
|
// On a Windows runner.
|
||||||
|
toPlatformPath('/foo/bar') // => \foo\bar
|
||||||
|
|
||||||
|
// On a Linux runner.
|
||||||
|
toPlatformPath('\\foo\\bar') // => /foo/bar
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Platform helper
|
||||||
|
|
||||||
|
Provides shorthands for getting information about platform action is running on.
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { platform } from '@actions/core'
|
||||||
|
|
||||||
|
/* equals to a call of os.platform() */
|
||||||
|
platform.platform // 'win32' | 'darwin' | 'linux' | 'freebsd' | 'openbsd' | 'android' | 'cygwin' | 'sunos'
|
||||||
|
|
||||||
|
/* equals to a call of os.arch() */
|
||||||
|
platform.arch // 'x64' | 'arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 'riscv64' | 's390' | 's390x'
|
||||||
|
|
||||||
|
/* common shorthands for platform-specific logic */
|
||||||
|
platform.isWindows // true
|
||||||
|
platform.isMacOS // false
|
||||||
|
platform.isLinux // false
|
||||||
|
|
||||||
|
/* run platform-specific script to get more details about the exact platform, works on Windows, MacOS and Linux */
|
||||||
|
const {
|
||||||
|
name, // Microsoft Windows 11 Enterprise
|
||||||
|
version, // 10.0.22621
|
||||||
|
} = await platform.getDetails()
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Populating job summary
|
||||||
|
|
||||||
|
These methods can be used to populate a [job summary](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary). A job summary is a buffer that can be added to throughout your job via `core.summary` methods.
|
||||||
|
|
||||||
|
Job summaries when complete must be written to the summary buffer file via the `core.summary.write()` method.
|
||||||
|
|
||||||
|
All methods except `addRaw()` utilize the `addRaw()` method to append to the buffer, followed by an EOL using the `addEOL()` method.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
|
||||||
|
// Write raw text, optionally add an EOL after the content, defaults to false
|
||||||
|
core.summary.addRaw('Some content here :speech_balloon:', true)
|
||||||
|
// Output: Some content here :speech_balloon:\n
|
||||||
|
|
||||||
|
// Add an operating system-specific end-of-line marker
|
||||||
|
core.summary.addEOL()
|
||||||
|
// Output (POSIX): \n
|
||||||
|
// Output (Windows): \r\n
|
||||||
|
|
||||||
|
// Add a codeblock with an optional language for syntax highlighting
|
||||||
|
core.summary.addCodeBlock('console.log(\'hello world\')', 'javascript')
|
||||||
|
// Output: <pre lang="javascript"><code>console.log('hello world')</code></pre>
|
||||||
|
|
||||||
|
// Add a list, second parameter indicates if list is ordered, defaults to false
|
||||||
|
core.summary.addList(['item1','item2','item3'], true)
|
||||||
|
// Output: <ol><li>item1</li><li>item2</li><li>item3</li></ol>
|
||||||
|
|
||||||
|
// Add a collapsible HTML details element
|
||||||
|
core.summary.addDetails('Label', 'Some detail that will be collapsed')
|
||||||
|
// Output: <details><summary>Label</summary>Some detail that will be collapsed</details>
|
||||||
|
|
||||||
|
// Add an image, image options parameter is optional, you can supply one of or both width and height in pixels
|
||||||
|
core.summary.addImage('example.png', 'alt description of img', {width: '100', height: '100'})
|
||||||
|
// Output: <img src="example.png" alt="alt description of img" width="100" height="100">
|
||||||
|
|
||||||
|
// Add an HTML section heading element, optionally pass a level that translates to 'hX' ie. h2. Defaults to h1
|
||||||
|
core.summary.addHeading('My Heading', '2')
|
||||||
|
// Output: <h2>My Heading</h2>
|
||||||
|
|
||||||
|
// Add an HTML thematic break <hr>
|
||||||
|
core.summary.addSeparator()
|
||||||
|
// Output: <hr>
|
||||||
|
|
||||||
|
// Add an HTML line break <br>
|
||||||
|
core.summary.addBreak()
|
||||||
|
// Output: <br>
|
||||||
|
|
||||||
|
// Add an HTML blockquote with an optional citation
|
||||||
|
core.summary.addQuote('To be or not to be', 'Shakespeare')
|
||||||
|
// Output: <blockquote cite="Shakespeare">To be or not to be</blockquote>
|
||||||
|
|
||||||
|
// Add an HTML anchor tag
|
||||||
|
core.summary.addLink('click here', 'https://github.com')
|
||||||
|
// Output: <a href="https://github.com">click here</a>
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Tables are added using the `addTable()` method, and an array of `SummaryTableRow`.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
|
||||||
|
export type SummaryTableRow = (SummaryTableCell | string)[]
|
||||||
|
|
||||||
|
export interface SummaryTableCell {
|
||||||
|
/**
|
||||||
|
* Cell content
|
||||||
|
*/
|
||||||
|
data: string
|
||||||
|
/**
|
||||||
|
* Render cell as header
|
||||||
|
* (optional) default: false
|
||||||
|
*/
|
||||||
|
header?: boolean
|
||||||
|
/**
|
||||||
|
* Number of columns the cell extends
|
||||||
|
* (optional) default: '1'
|
||||||
|
*/
|
||||||
|
colspan?: string
|
||||||
|
/**
|
||||||
|
* Number of rows the cell extends
|
||||||
|
* (optional) default: '1'
|
||||||
|
*/
|
||||||
|
rowspan?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
For example
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
|
||||||
|
const tableData = [
|
||||||
|
{data: 'Header1', header: true},
|
||||||
|
{data: 'Header2', header: true},
|
||||||
|
{data: 'Header3', header: true},
|
||||||
|
{data: 'MyData1'},
|
||||||
|
{data: 'MyData2'},
|
||||||
|
{data: 'MyData3'}
|
||||||
|
]
|
||||||
|
|
||||||
|
// Add an HTML table
|
||||||
|
core.summary.addTable([tableData])
|
||||||
|
// Output: <table><tr><th>Header1</th><th>Header2</th><th>Header3</th></tr><tr></tr><td>MyData1</td><td>MyData2</td><td>MyData3</td></tr></table>
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
In addition to job summary content, there are utility functions for interfacing with the buffer.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
|
||||||
|
// Empties the summary buffer AND wipes the summary file on disk
|
||||||
|
core.summary.clear()
|
||||||
|
|
||||||
|
// Returns the current summary buffer as a string
|
||||||
|
core.summary.stringify()
|
||||||
|
|
||||||
|
// If the summary buffer is empty
|
||||||
|
core.summary.isEmptyBuffer()
|
||||||
|
|
||||||
|
// Resets the summary buffer without writing to the summary file on disk
|
||||||
|
core.summary.emptyBuffer()
|
||||||
|
|
||||||
|
// Writes text in the buffer to the summary buffer file and empties the buffer, optionally overwriting all existing content in the summary file with buffer contents. Defaults to false.
|
||||||
|
core.summary.write({overwrite: true})
|
||||||
|
```
|
||||||
38
node_modules/@actions/core/lib/command.d.ts
generated
vendored
38
node_modules/@actions/core/lib/command.d.ts
generated
vendored
@@ -1,16 +1,38 @@
|
|||||||
interface CommandProperties {
|
export interface CommandProperties {
|
||||||
[key: string]: string;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Commands
|
* Issues a command to the GitHub Actions runner
|
||||||
|
*
|
||||||
|
* @param command - The command name to issue
|
||||||
|
* @param properties - Additional properties for the command (key-value pairs)
|
||||||
|
* @param message - The message to include with the command
|
||||||
|
* @remarks
|
||||||
|
* This function outputs a specially formatted string to stdout that the Actions
|
||||||
|
* runner interprets as a command. These commands can control workflow behavior,
|
||||||
|
* set outputs, create annotations, mask values, and more.
|
||||||
*
|
*
|
||||||
* Command Format:
|
* Command Format:
|
||||||
* ::name key=value,key=value::message
|
* ::name key=value,key=value::message
|
||||||
*
|
*
|
||||||
* Examples:
|
* @example
|
||||||
* ::warning::This is the message
|
* ```typescript
|
||||||
* ::set-env name=MY_VAR::some value
|
* // Issue a warning annotation
|
||||||
|
* issueCommand('warning', {}, 'This is a warning message');
|
||||||
|
* // Output: ::warning::This is a warning message
|
||||||
|
*
|
||||||
|
* // Set an environment variable
|
||||||
|
* issueCommand('set-env', { name: 'MY_VAR' }, 'some value');
|
||||||
|
* // Output: ::set-env name=MY_VAR::some value
|
||||||
|
*
|
||||||
|
* // Add a secret mask
|
||||||
|
* issueCommand('add-mask', {}, 'secretValue123');
|
||||||
|
* // Output: ::add-mask::secretValue123
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
* This is an internal utility function that powers the public API functions
|
||||||
|
* such as setSecret, warning, error, and exportVariable.
|
||||||
*/
|
*/
|
||||||
export declare function issueCommand(command: string, properties: CommandProperties, message: string): void;
|
export declare function issueCommand(command: string, properties: CommandProperties, message: any): void;
|
||||||
export declare function issue(name: string, message?: string): void;
|
export declare function issue(name: string, message?: string): void;
|
||||||
export {};
|
|
||||||
|
|||||||
53
node_modules/@actions/core/lib/command.js
generated
vendored
53
node_modules/@actions/core/lib/command.js
generated
vendored
@@ -1,32 +1,45 @@
|
|||||||
"use strict";
|
import * as os from 'os';
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
import { toCommandValue } from './utils.js';
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
||||||
result["default"] = mod;
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const os = __importStar(require("os"));
|
|
||||||
/**
|
/**
|
||||||
* Commands
|
* Issues a command to the GitHub Actions runner
|
||||||
|
*
|
||||||
|
* @param command - The command name to issue
|
||||||
|
* @param properties - Additional properties for the command (key-value pairs)
|
||||||
|
* @param message - The message to include with the command
|
||||||
|
* @remarks
|
||||||
|
* This function outputs a specially formatted string to stdout that the Actions
|
||||||
|
* runner interprets as a command. These commands can control workflow behavior,
|
||||||
|
* set outputs, create annotations, mask values, and more.
|
||||||
*
|
*
|
||||||
* Command Format:
|
* Command Format:
|
||||||
* ::name key=value,key=value::message
|
* ::name key=value,key=value::message
|
||||||
*
|
*
|
||||||
* Examples:
|
* @example
|
||||||
* ::warning::This is the message
|
* ```typescript
|
||||||
* ::set-env name=MY_VAR::some value
|
* // Issue a warning annotation
|
||||||
|
* issueCommand('warning', {}, 'This is a warning message');
|
||||||
|
* // Output: ::warning::This is a warning message
|
||||||
|
*
|
||||||
|
* // Set an environment variable
|
||||||
|
* issueCommand('set-env', { name: 'MY_VAR' }, 'some value');
|
||||||
|
* // Output: ::set-env name=MY_VAR::some value
|
||||||
|
*
|
||||||
|
* // Add a secret mask
|
||||||
|
* issueCommand('add-mask', {}, 'secretValue123');
|
||||||
|
* // Output: ::add-mask::secretValue123
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
* This is an internal utility function that powers the public API functions
|
||||||
|
* such as setSecret, warning, error, and exportVariable.
|
||||||
*/
|
*/
|
||||||
function issueCommand(command, properties, message) {
|
export function issueCommand(command, properties, message) {
|
||||||
const cmd = new Command(command, properties, message);
|
const cmd = new Command(command, properties, message);
|
||||||
process.stdout.write(cmd.toString() + os.EOL);
|
process.stdout.write(cmd.toString() + os.EOL);
|
||||||
}
|
}
|
||||||
exports.issueCommand = issueCommand;
|
export function issue(name, message = '') {
|
||||||
function issue(name, message = '') {
|
|
||||||
issueCommand(name, {}, message);
|
issueCommand(name, {}, message);
|
||||||
}
|
}
|
||||||
exports.issue = issue;
|
|
||||||
const CMD_STRING = '::';
|
const CMD_STRING = '::';
|
||||||
class Command {
|
class Command {
|
||||||
constructor(command, properties, message) {
|
constructor(command, properties, message) {
|
||||||
@@ -62,13 +75,13 @@ class Command {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function escapeData(s) {
|
function escapeData(s) {
|
||||||
return (s || '')
|
return toCommandValue(s)
|
||||||
.replace(/%/g, '%25')
|
.replace(/%/g, '%25')
|
||||||
.replace(/\r/g, '%0D')
|
.replace(/\r/g, '%0D')
|
||||||
.replace(/\n/g, '%0A');
|
.replace(/\n/g, '%0A');
|
||||||
}
|
}
|
||||||
function escapeProperty(s) {
|
function escapeProperty(s) {
|
||||||
return (s || '')
|
return toCommandValue(s)
|
||||||
.replace(/%/g, '%25')
|
.replace(/%/g, '%25')
|
||||||
.replace(/\r/g, '%0D')
|
.replace(/\r/g, '%0D')
|
||||||
.replace(/\n/g, '%0A')
|
.replace(/\n/g, '%0A')
|
||||||
|
|||||||
2
node_modules/@actions/core/lib/command.js.map
generated
vendored
2
node_modules/@actions/core/lib/command.js.map
generated
vendored
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAwB;AAQxB;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAe;IAEf,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,UAAkB,EAAE;IACtD,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,iBAAiB,CAAA;SAC5B;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,QAAQ;QACN,IAAI,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;QAEtC,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9D,MAAM,IAAI,GAAG,CAAA;YACb,IAAI,KAAK,GAAG,IAAI,CAAA;YAChB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE;wBACP,IAAI,KAAK,EAAE;4BACT,KAAK,GAAG,KAAK,CAAA;yBACd;6BAAM;4BACL,MAAM,IAAI,GAAG,CAAA;yBACd;wBAED,MAAM,IAAI,GAAG,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAA;qBAC1C;iBACF;aACF;SACF;QAED,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAA;QACpD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;SACb,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,CAAS;IAC/B,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;SACb,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"}
|
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAA;AAWzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,UAAU,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAY;IAEZ,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,IAAY,EAAE,OAAO,GAAG,EAAE;IAC9C,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,iBAAiB,CAAA;QAC7B,CAAC;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,QAAQ;QACN,IAAI,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;QAEtC,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/D,MAAM,IAAI,GAAG,CAAA;YACb,IAAI,KAAK,GAAG,IAAI,CAAA;YAChB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBAClC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;oBACxC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE,CAAC;wBACR,IAAI,KAAK,EAAE,CAAC;4BACV,KAAK,GAAG,KAAK,CAAA;wBACf,CAAC;6BAAM,CAAC;4BACN,MAAM,IAAI,GAAG,CAAA;wBACf,CAAC;wBAED,MAAM,IAAI,GAAG,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAA;oBAC3C,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAA;QACpD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,UAAU,CAAC,CAAM;IACxB,OAAO,cAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,CAAM;IAC5B,OAAO,cAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"}
|
||||||
139
node_modules/@actions/core/lib/core.d.ts
generated
vendored
139
node_modules/@actions/core/lib/core.d.ts
generated
vendored
@@ -4,6 +4,8 @@
|
|||||||
export interface InputOptions {
|
export interface InputOptions {
|
||||||
/** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */
|
/** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */
|
||||||
required?: boolean;
|
required?: boolean;
|
||||||
|
/** Optional. Whether leading/trailing whitespace will be trimmed for the input. Defaults to true */
|
||||||
|
trimWhitespace?: boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The code to exit an action
|
* The code to exit an action
|
||||||
@@ -18,15 +20,71 @@ export declare enum ExitCode {
|
|||||||
*/
|
*/
|
||||||
Failure = 1
|
Failure = 1
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Optional properties that can be sent with annotation commands (notice, error, and warning)
|
||||||
|
* See: https://docs.github.com/en/rest/reference/checks#create-a-check-run for more information about annotations.
|
||||||
|
*/
|
||||||
|
export interface AnnotationProperties {
|
||||||
|
/**
|
||||||
|
* A title for the annotation.
|
||||||
|
*/
|
||||||
|
title?: string;
|
||||||
|
/**
|
||||||
|
* The path of the file for which the annotation should be created.
|
||||||
|
*/
|
||||||
|
file?: string;
|
||||||
|
/**
|
||||||
|
* The start line for the annotation.
|
||||||
|
*/
|
||||||
|
startLine?: number;
|
||||||
|
/**
|
||||||
|
* The end line for the annotation. Defaults to `startLine` when `startLine` is provided.
|
||||||
|
*/
|
||||||
|
endLine?: number;
|
||||||
|
/**
|
||||||
|
* The start column for the annotation. Cannot be sent when `startLine` and `endLine` are different values.
|
||||||
|
*/
|
||||||
|
startColumn?: number;
|
||||||
|
/**
|
||||||
|
* The end column for the annotation. Cannot be sent when `startLine` and `endLine` are different values.
|
||||||
|
* Defaults to `startColumn` when `startColumn` is provided.
|
||||||
|
*/
|
||||||
|
endColumn?: number;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Sets env variable for this action and future actions in the job
|
* Sets env variable for this action and future actions in the job
|
||||||
* @param name the name of the variable to set
|
* @param name the name of the variable to set
|
||||||
* @param val the value of the variable
|
* @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
|
||||||
*/
|
*/
|
||||||
export declare function exportVariable(name: string, val: string): void;
|
export declare function exportVariable(name: string, val: any): void;
|
||||||
/**
|
/**
|
||||||
* Registers a secret which will get masked from logs
|
* Registers a secret which will get masked from logs
|
||||||
* @param secret value of the secret
|
*
|
||||||
|
* @param secret - Value of the secret to be masked
|
||||||
|
* @remarks
|
||||||
|
* This function instructs the Actions runner to mask the specified value in any
|
||||||
|
* logs produced during the workflow run. Once registered, the secret value will
|
||||||
|
* be replaced with asterisks (***) whenever it appears in console output, logs,
|
||||||
|
* or error messages.
|
||||||
|
*
|
||||||
|
* This is useful for protecting sensitive information such as:
|
||||||
|
* - API keys
|
||||||
|
* - Access tokens
|
||||||
|
* - Authentication credentials
|
||||||
|
* - URL parameters containing signatures (SAS tokens)
|
||||||
|
*
|
||||||
|
* Note that masking only affects future logs; any previous appearances of the
|
||||||
|
* secret in logs before calling this function will remain unmasked.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```typescript
|
||||||
|
* // Register an API token as a secret
|
||||||
|
* const apiToken = "abc123xyz456";
|
||||||
|
* setSecret(apiToken);
|
||||||
|
*
|
||||||
|
* // Now any logs containing this value will show *** instead
|
||||||
|
* console.log(`Using token: ${apiToken}`); // Outputs: "Using token: ***"
|
||||||
|
* ```
|
||||||
*/
|
*/
|
||||||
export declare function setSecret(secret: string): void;
|
export declare function setSecret(secret: string): void;
|
||||||
/**
|
/**
|
||||||
@@ -35,26 +93,54 @@ export declare function setSecret(secret: string): void;
|
|||||||
*/
|
*/
|
||||||
export declare function addPath(inputPath: string): void;
|
export declare function addPath(inputPath: string): void;
|
||||||
/**
|
/**
|
||||||
* Gets the value of an input. The value is also trimmed.
|
* Gets the value of an input.
|
||||||
|
* Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
|
||||||
|
* Returns an empty string if the value is not defined.
|
||||||
*
|
*
|
||||||
* @param name name of the input to get
|
* @param name name of the input to get
|
||||||
* @param options optional. See InputOptions.
|
* @param options optional. See InputOptions.
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
export declare function getInput(name: string, options?: InputOptions): string;
|
export declare function getInput(name: string, options?: InputOptions): string;
|
||||||
|
/**
|
||||||
|
* Gets the values of an multiline input. Each value is also trimmed.
|
||||||
|
*
|
||||||
|
* @param name name of the input to get
|
||||||
|
* @param options optional. See InputOptions.
|
||||||
|
* @returns string[]
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export declare function getMultilineInput(name: string, options?: InputOptions): string[];
|
||||||
|
/**
|
||||||
|
* Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
|
||||||
|
* Support boolean input list: `true | True | TRUE | false | False | FALSE` .
|
||||||
|
* The return value is also in boolean type.
|
||||||
|
* ref: https://yaml.org/spec/1.2/spec.html#id2804923
|
||||||
|
*
|
||||||
|
* @param name name of the input to get
|
||||||
|
* @param options optional. See InputOptions.
|
||||||
|
* @returns boolean
|
||||||
|
*/
|
||||||
|
export declare function getBooleanInput(name: string, options?: InputOptions): boolean;
|
||||||
/**
|
/**
|
||||||
* Sets the value of an output.
|
* Sets the value of an output.
|
||||||
*
|
*
|
||||||
* @param name name of the output to set
|
* @param name name of the output to set
|
||||||
* @param value value to store
|
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
||||||
*/
|
*/
|
||||||
export declare function setOutput(name: string, value: string): void;
|
export declare function setOutput(name: string, value: any): void;
|
||||||
|
/**
|
||||||
|
* Enables or disables the echoing of commands into stdout for the rest of the step.
|
||||||
|
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export declare function setCommandEcho(enabled: boolean): void;
|
||||||
/**
|
/**
|
||||||
* Sets the action status to failed.
|
* Sets the action status to failed.
|
||||||
* When the action exits it will be with an exit code of 1
|
* When the action exits it will be with an exit code of 1
|
||||||
* @param message add error issue message
|
* @param message add error issue message
|
||||||
*/
|
*/
|
||||||
export declare function setFailed(message: string): void;
|
export declare function setFailed(message: string | Error): void;
|
||||||
/**
|
/**
|
||||||
* Gets whether Actions Step Debug is on or not
|
* Gets whether Actions Step Debug is on or not
|
||||||
*/
|
*/
|
||||||
@@ -66,14 +152,22 @@ export declare function isDebug(): boolean;
|
|||||||
export declare function debug(message: string): void;
|
export declare function debug(message: string): void;
|
||||||
/**
|
/**
|
||||||
* Adds an error issue
|
* Adds an error issue
|
||||||
* @param message error issue message
|
* @param message error issue message. Errors will be converted to string via toString()
|
||||||
|
* @param properties optional properties to add to the annotation.
|
||||||
*/
|
*/
|
||||||
export declare function error(message: string): void;
|
export declare function error(message: string | Error, properties?: AnnotationProperties): void;
|
||||||
/**
|
/**
|
||||||
* Adds an warning issue
|
* Adds a warning issue
|
||||||
* @param message warning issue message
|
* @param message warning issue message. Errors will be converted to string via toString()
|
||||||
|
* @param properties optional properties to add to the annotation.
|
||||||
*/
|
*/
|
||||||
export declare function warning(message: string): void;
|
export declare function warning(message: string | Error, properties?: AnnotationProperties): void;
|
||||||
|
/**
|
||||||
|
* Adds a notice issue
|
||||||
|
* @param message notice issue message. Errors will be converted to string via toString()
|
||||||
|
* @param properties optional properties to add to the annotation.
|
||||||
|
*/
|
||||||
|
export declare function notice(message: string | Error, properties?: AnnotationProperties): void;
|
||||||
/**
|
/**
|
||||||
* Writes info to log with console.log.
|
* Writes info to log with console.log.
|
||||||
* @param message info message
|
* @param message info message
|
||||||
@@ -104,9 +198,9 @@ export declare function group<T>(name: string, fn: () => Promise<T>): Promise<T>
|
|||||||
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
||||||
*
|
*
|
||||||
* @param name name of the state to store
|
* @param name name of the state to store
|
||||||
* @param value value to store
|
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
||||||
*/
|
*/
|
||||||
export declare function saveState(name: string, value: string): void;
|
export declare function saveState(name: string, value: any): void;
|
||||||
/**
|
/**
|
||||||
* Gets the value of an state set by this action's main execution.
|
* Gets the value of an state set by this action's main execution.
|
||||||
*
|
*
|
||||||
@@ -114,3 +208,20 @@ export declare function saveState(name: string, value: string): void;
|
|||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
export declare function getState(name: string): string;
|
export declare function getState(name: string): string;
|
||||||
|
export declare function getIDToken(aud?: string): Promise<string>;
|
||||||
|
/**
|
||||||
|
* Summary exports
|
||||||
|
*/
|
||||||
|
export { summary } from './summary.js';
|
||||||
|
/**
|
||||||
|
* @deprecated use core.summary
|
||||||
|
*/
|
||||||
|
export { markdownSummary } from './summary.js';
|
||||||
|
/**
|
||||||
|
* Path exports
|
||||||
|
*/
|
||||||
|
export { toPosixPath, toWin32Path, toPlatformPath } from './path-utils.js';
|
||||||
|
/**
|
||||||
|
* Platform utilities exports
|
||||||
|
*/
|
||||||
|
export * as platform from './platform.js';
|
||||||
|
|||||||
238
node_modules/@actions/core/lib/core.js
generated
vendored
238
node_modules/@actions/core/lib/core.js
generated
vendored
@@ -1,4 +1,3 @@
|
|||||||
"use strict";
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
@@ -8,21 +7,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
import { issue, issueCommand } from './command.js';
|
||||||
if (mod && mod.__esModule) return mod;
|
import { issueFileCommand, prepareKeyValueMessage } from './file-command.js';
|
||||||
var result = {};
|
import { toCommandProperties, toCommandValue } from './utils.js';
|
||||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
import * as os from 'os';
|
||||||
result["default"] = mod;
|
import * as path from 'path';
|
||||||
return result;
|
import { OidcClient } from './oidc-utils.js';
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const command_1 = require("./command");
|
|
||||||
const os = __importStar(require("os"));
|
|
||||||
const path = __importStar(require("path"));
|
|
||||||
/**
|
/**
|
||||||
* The code to exit an action
|
* The code to exit an action
|
||||||
*/
|
*/
|
||||||
var ExitCode;
|
export var ExitCode;
|
||||||
(function (ExitCode) {
|
(function (ExitCode) {
|
||||||
/**
|
/**
|
||||||
* A code indicating that the action was successful
|
* A code indicating that the action was successful
|
||||||
@@ -32,62 +26,151 @@ var ExitCode;
|
|||||||
* A code indicating that the action was a failure
|
* A code indicating that the action was a failure
|
||||||
*/
|
*/
|
||||||
ExitCode[ExitCode["Failure"] = 1] = "Failure";
|
ExitCode[ExitCode["Failure"] = 1] = "Failure";
|
||||||
})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
|
})(ExitCode || (ExitCode = {}));
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// Variables
|
// Variables
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* Sets env variable for this action and future actions in the job
|
* Sets env variable for this action and future actions in the job
|
||||||
* @param name the name of the variable to set
|
* @param name the name of the variable to set
|
||||||
* @param val the value of the variable
|
* @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
|
||||||
*/
|
*/
|
||||||
function exportVariable(name, val) {
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
process.env[name] = val;
|
export function exportVariable(name, val) {
|
||||||
command_1.issueCommand('set-env', { name }, val);
|
const convertedVal = toCommandValue(val);
|
||||||
|
process.env[name] = convertedVal;
|
||||||
|
const filePath = process.env['GITHUB_ENV'] || '';
|
||||||
|
if (filePath) {
|
||||||
|
return issueFileCommand('ENV', prepareKeyValueMessage(name, val));
|
||||||
|
}
|
||||||
|
issueCommand('set-env', { name }, convertedVal);
|
||||||
}
|
}
|
||||||
exports.exportVariable = exportVariable;
|
|
||||||
/**
|
/**
|
||||||
* Registers a secret which will get masked from logs
|
* Registers a secret which will get masked from logs
|
||||||
* @param secret value of the secret
|
*
|
||||||
|
* @param secret - Value of the secret to be masked
|
||||||
|
* @remarks
|
||||||
|
* This function instructs the Actions runner to mask the specified value in any
|
||||||
|
* logs produced during the workflow run. Once registered, the secret value will
|
||||||
|
* be replaced with asterisks (***) whenever it appears in console output, logs,
|
||||||
|
* or error messages.
|
||||||
|
*
|
||||||
|
* This is useful for protecting sensitive information such as:
|
||||||
|
* - API keys
|
||||||
|
* - Access tokens
|
||||||
|
* - Authentication credentials
|
||||||
|
* - URL parameters containing signatures (SAS tokens)
|
||||||
|
*
|
||||||
|
* Note that masking only affects future logs; any previous appearances of the
|
||||||
|
* secret in logs before calling this function will remain unmasked.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```typescript
|
||||||
|
* // Register an API token as a secret
|
||||||
|
* const apiToken = "abc123xyz456";
|
||||||
|
* setSecret(apiToken);
|
||||||
|
*
|
||||||
|
* // Now any logs containing this value will show *** instead
|
||||||
|
* console.log(`Using token: ${apiToken}`); // Outputs: "Using token: ***"
|
||||||
|
* ```
|
||||||
*/
|
*/
|
||||||
function setSecret(secret) {
|
export function setSecret(secret) {
|
||||||
command_1.issueCommand('add-mask', {}, secret);
|
issueCommand('add-mask', {}, secret);
|
||||||
}
|
}
|
||||||
exports.setSecret = setSecret;
|
|
||||||
/**
|
/**
|
||||||
* Prepends inputPath to the PATH (for this action and future actions)
|
* Prepends inputPath to the PATH (for this action and future actions)
|
||||||
* @param inputPath
|
* @param inputPath
|
||||||
*/
|
*/
|
||||||
function addPath(inputPath) {
|
export function addPath(inputPath) {
|
||||||
command_1.issueCommand('add-path', {}, inputPath);
|
const filePath = process.env['GITHUB_PATH'] || '';
|
||||||
|
if (filePath) {
|
||||||
|
issueFileCommand('PATH', inputPath);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
issueCommand('add-path', {}, inputPath);
|
||||||
|
}
|
||||||
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
|
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
|
||||||
}
|
}
|
||||||
exports.addPath = addPath;
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of an input. The value is also trimmed.
|
* Gets the value of an input.
|
||||||
|
* Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
|
||||||
|
* Returns an empty string if the value is not defined.
|
||||||
*
|
*
|
||||||
* @param name name of the input to get
|
* @param name name of the input to get
|
||||||
* @param options optional. See InputOptions.
|
* @param options optional. See InputOptions.
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
function getInput(name, options) {
|
export function getInput(name, options) {
|
||||||
const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
|
const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
|
||||||
if (options && options.required && !val) {
|
if (options && options.required && !val) {
|
||||||
throw new Error(`Input required and not supplied: ${name}`);
|
throw new Error(`Input required and not supplied: ${name}`);
|
||||||
}
|
}
|
||||||
|
if (options && options.trimWhitespace === false) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
return val.trim();
|
return val.trim();
|
||||||
}
|
}
|
||||||
exports.getInput = getInput;
|
/**
|
||||||
|
* Gets the values of an multiline input. Each value is also trimmed.
|
||||||
|
*
|
||||||
|
* @param name name of the input to get
|
||||||
|
* @param options optional. See InputOptions.
|
||||||
|
* @returns string[]
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export function getMultilineInput(name, options) {
|
||||||
|
const inputs = getInput(name, options)
|
||||||
|
.split('\n')
|
||||||
|
.filter(x => x !== '');
|
||||||
|
if (options && options.trimWhitespace === false) {
|
||||||
|
return inputs;
|
||||||
|
}
|
||||||
|
return inputs.map(input => input.trim());
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
|
||||||
|
* Support boolean input list: `true | True | TRUE | false | False | FALSE` .
|
||||||
|
* The return value is also in boolean type.
|
||||||
|
* ref: https://yaml.org/spec/1.2/spec.html#id2804923
|
||||||
|
*
|
||||||
|
* @param name name of the input to get
|
||||||
|
* @param options optional. See InputOptions.
|
||||||
|
* @returns boolean
|
||||||
|
*/
|
||||||
|
export function getBooleanInput(name, options) {
|
||||||
|
const trueValue = ['true', 'True', 'TRUE'];
|
||||||
|
const falseValue = ['false', 'False', 'FALSE'];
|
||||||
|
const val = getInput(name, options);
|
||||||
|
if (trueValue.includes(val))
|
||||||
|
return true;
|
||||||
|
if (falseValue.includes(val))
|
||||||
|
return false;
|
||||||
|
throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
|
||||||
|
`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Sets the value of an output.
|
* Sets the value of an output.
|
||||||
*
|
*
|
||||||
* @param name name of the output to set
|
* @param name name of the output to set
|
||||||
* @param value value to store
|
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
||||||
*/
|
*/
|
||||||
function setOutput(name, value) {
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
command_1.issueCommand('set-output', { name }, value);
|
export function setOutput(name, value) {
|
||||||
|
const filePath = process.env['GITHUB_OUTPUT'] || '';
|
||||||
|
if (filePath) {
|
||||||
|
return issueFileCommand('OUTPUT', prepareKeyValueMessage(name, value));
|
||||||
|
}
|
||||||
|
process.stdout.write(os.EOL);
|
||||||
|
issueCommand('set-output', { name }, toCommandValue(value));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Enables or disables the echoing of commands into stdout for the rest of the step.
|
||||||
|
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export function setCommandEcho(enabled) {
|
||||||
|
issue('echo', enabled ? 'on' : 'off');
|
||||||
}
|
}
|
||||||
exports.setOutput = setOutput;
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// Results
|
// Results
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
@@ -96,53 +179,57 @@ exports.setOutput = setOutput;
|
|||||||
* When the action exits it will be with an exit code of 1
|
* When the action exits it will be with an exit code of 1
|
||||||
* @param message add error issue message
|
* @param message add error issue message
|
||||||
*/
|
*/
|
||||||
function setFailed(message) {
|
export function setFailed(message) {
|
||||||
process.exitCode = ExitCode.Failure;
|
process.exitCode = ExitCode.Failure;
|
||||||
error(message);
|
error(message);
|
||||||
}
|
}
|
||||||
exports.setFailed = setFailed;
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// Logging Commands
|
// Logging Commands
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* Gets whether Actions Step Debug is on or not
|
* Gets whether Actions Step Debug is on or not
|
||||||
*/
|
*/
|
||||||
function isDebug() {
|
export function isDebug() {
|
||||||
return process.env['RUNNER_DEBUG'] === '1';
|
return process.env['RUNNER_DEBUG'] === '1';
|
||||||
}
|
}
|
||||||
exports.isDebug = isDebug;
|
|
||||||
/**
|
/**
|
||||||
* Writes debug message to user log
|
* Writes debug message to user log
|
||||||
* @param message debug message
|
* @param message debug message
|
||||||
*/
|
*/
|
||||||
function debug(message) {
|
export function debug(message) {
|
||||||
command_1.issueCommand('debug', {}, message);
|
issueCommand('debug', {}, message);
|
||||||
}
|
}
|
||||||
exports.debug = debug;
|
|
||||||
/**
|
/**
|
||||||
* Adds an error issue
|
* Adds an error issue
|
||||||
* @param message error issue message
|
* @param message error issue message. Errors will be converted to string via toString()
|
||||||
|
* @param properties optional properties to add to the annotation.
|
||||||
*/
|
*/
|
||||||
function error(message) {
|
export function error(message, properties = {}) {
|
||||||
command_1.issue('error', message);
|
issueCommand('error', toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
||||||
}
|
}
|
||||||
exports.error = error;
|
|
||||||
/**
|
/**
|
||||||
* Adds an warning issue
|
* Adds a warning issue
|
||||||
* @param message warning issue message
|
* @param message warning issue message. Errors will be converted to string via toString()
|
||||||
|
* @param properties optional properties to add to the annotation.
|
||||||
*/
|
*/
|
||||||
function warning(message) {
|
export function warning(message, properties = {}) {
|
||||||
command_1.issue('warning', message);
|
issueCommand('warning', toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds a notice issue
|
||||||
|
* @param message notice issue message. Errors will be converted to string via toString()
|
||||||
|
* @param properties optional properties to add to the annotation.
|
||||||
|
*/
|
||||||
|
export function notice(message, properties = {}) {
|
||||||
|
issueCommand('notice', toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
||||||
}
|
}
|
||||||
exports.warning = warning;
|
|
||||||
/**
|
/**
|
||||||
* Writes info to log with console.log.
|
* Writes info to log with console.log.
|
||||||
* @param message info message
|
* @param message info message
|
||||||
*/
|
*/
|
||||||
function info(message) {
|
export function info(message) {
|
||||||
process.stdout.write(message + os.EOL);
|
process.stdout.write(message + os.EOL);
|
||||||
}
|
}
|
||||||
exports.info = info;
|
|
||||||
/**
|
/**
|
||||||
* Begin an output group.
|
* Begin an output group.
|
||||||
*
|
*
|
||||||
@@ -150,17 +237,15 @@ exports.info = info;
|
|||||||
*
|
*
|
||||||
* @param name The name of the output group
|
* @param name The name of the output group
|
||||||
*/
|
*/
|
||||||
function startGroup(name) {
|
export function startGroup(name) {
|
||||||
command_1.issue('group', name);
|
issue('group', name);
|
||||||
}
|
}
|
||||||
exports.startGroup = startGroup;
|
|
||||||
/**
|
/**
|
||||||
* End an output group.
|
* End an output group.
|
||||||
*/
|
*/
|
||||||
function endGroup() {
|
export function endGroup() {
|
||||||
command_1.issue('endgroup');
|
issue('endgroup');
|
||||||
}
|
}
|
||||||
exports.endGroup = endGroup;
|
|
||||||
/**
|
/**
|
||||||
* Wrap an asynchronous function call in a group.
|
* Wrap an asynchronous function call in a group.
|
||||||
*
|
*
|
||||||
@@ -169,7 +254,7 @@ exports.endGroup = endGroup;
|
|||||||
* @param name The name of the group
|
* @param name The name of the group
|
||||||
* @param fn The function to wrap in the group
|
* @param fn The function to wrap in the group
|
||||||
*/
|
*/
|
||||||
function group(name, fn) {
|
export function group(name, fn) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
startGroup(name);
|
startGroup(name);
|
||||||
let result;
|
let result;
|
||||||
@@ -182,7 +267,6 @@ function group(name, fn) {
|
|||||||
return result;
|
return result;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.group = group;
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// Wrapper action state
|
// Wrapper action state
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
@@ -190,20 +274,44 @@ exports.group = group;
|
|||||||
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
||||||
*
|
*
|
||||||
* @param name name of the state to store
|
* @param name name of the state to store
|
||||||
* @param value value to store
|
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
||||||
*/
|
*/
|
||||||
function saveState(name, value) {
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
command_1.issueCommand('save-state', { name }, value);
|
export function saveState(name, value) {
|
||||||
|
const filePath = process.env['GITHUB_STATE'] || '';
|
||||||
|
if (filePath) {
|
||||||
|
return issueFileCommand('STATE', prepareKeyValueMessage(name, value));
|
||||||
|
}
|
||||||
|
issueCommand('save-state', { name }, toCommandValue(value));
|
||||||
}
|
}
|
||||||
exports.saveState = saveState;
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of an state set by this action's main execution.
|
* Gets the value of an state set by this action's main execution.
|
||||||
*
|
*
|
||||||
* @param name name of the state to get
|
* @param name name of the state to get
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
function getState(name) {
|
export function getState(name) {
|
||||||
return process.env[`STATE_${name}`] || '';
|
return process.env[`STATE_${name}`] || '';
|
||||||
}
|
}
|
||||||
exports.getState = getState;
|
export function getIDToken(aud) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return yield OidcClient.getIDToken(aud);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Summary exports
|
||||||
|
*/
|
||||||
|
export { summary } from './summary.js';
|
||||||
|
/**
|
||||||
|
* @deprecated use core.summary
|
||||||
|
*/
|
||||||
|
export { markdownSummary } from './summary.js';
|
||||||
|
/**
|
||||||
|
* Path exports
|
||||||
|
*/
|
||||||
|
export { toPosixPath, toWin32Path, toPlatformPath } from './path-utils.js';
|
||||||
|
/**
|
||||||
|
* Platform utilities exports
|
||||||
|
*/
|
||||||
|
export * as platform from './platform.js';
|
||||||
//# sourceMappingURL=core.js.map
|
//# sourceMappingURL=core.js.map
|
||||||
2
node_modules/@actions/core/lib/core.js.map
generated
vendored
2
node_modules/@actions/core/lib/core.js.map
generated
vendored
File diff suppressed because one or more lines are too long
2
node_modules/@actions/core/lib/file-command.d.ts
generated
vendored
Normal file
2
node_modules/@actions/core/lib/file-command.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export declare function issueFileCommand(command: string, message: any): void;
|
||||||
|
export declare function prepareKeyValueMessage(key: string, value: any): string;
|
||||||
34
node_modules/@actions/core/lib/file-command.js
generated
vendored
Normal file
34
node_modules/@actions/core/lib/file-command.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
// For internal use, subject to change.
|
||||||
|
// We use any as a valid input type
|
||||||
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
import * as crypto from 'crypto';
|
||||||
|
import * as fs from 'fs';
|
||||||
|
import * as os from 'os';
|
||||||
|
import { toCommandValue } from './utils.js';
|
||||||
|
export function issueFileCommand(command, message) {
|
||||||
|
const filePath = process.env[`GITHUB_${command}`];
|
||||||
|
if (!filePath) {
|
||||||
|
throw new Error(`Unable to find environment variable for file command ${command}`);
|
||||||
|
}
|
||||||
|
if (!fs.existsSync(filePath)) {
|
||||||
|
throw new Error(`Missing file at path: ${filePath}`);
|
||||||
|
}
|
||||||
|
fs.appendFileSync(filePath, `${toCommandValue(message)}${os.EOL}`, {
|
||||||
|
encoding: 'utf8'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export function prepareKeyValueMessage(key, value) {
|
||||||
|
const delimiter = `ghadelimiter_${crypto.randomUUID()}`;
|
||||||
|
const convertedValue = toCommandValue(value);
|
||||||
|
// These should realistically never happen, but just in case someone finds a
|
||||||
|
// way to exploit uuid generation let's not allow keys or values that contain
|
||||||
|
// the delimiter.
|
||||||
|
if (key.includes(delimiter)) {
|
||||||
|
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
|
||||||
|
}
|
||||||
|
if (convertedValue.includes(delimiter)) {
|
||||||
|
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
|
||||||
|
}
|
||||||
|
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=file-command.js.map
|
||||||
1
node_modules/@actions/core/lib/file-command.js.map
generated
vendored
Normal file
1
node_modules/@actions/core/lib/file-command.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"file-command.js","sourceRoot":"","sources":["../src/file-command.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAEvC,mCAAmC;AACnC,uDAAuD;AAEvD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAA;AAEzC,MAAM,UAAU,gBAAgB,CAAC,OAAe,EAAE,OAAY;IAC5D,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,OAAO,EAAE,CAAC,CAAA;IACjD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CACb,wDAAwD,OAAO,EAAE,CAClE,CAAA;IACH,CAAC;IACD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,yBAAyB,QAAQ,EAAE,CAAC,CAAA;IACtD,CAAC;IAED,EAAE,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;QACjE,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,GAAW,EAAE,KAAU;IAC5D,MAAM,SAAS,GAAG,gBAAgB,MAAM,CAAC,UAAU,EAAE,EAAE,CAAA;IACvD,MAAM,cAAc,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;IAE5C,4EAA4E;IAC5E,6EAA6E;IAC7E,iBAAiB;IACjB,IAAI,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CACb,4DAA4D,SAAS,GAAG,CACzE,CAAA;IACH,CAAC;IAED,IAAI,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CACb,6DAA6D,SAAS,GAAG,CAC1E,CAAA;IACH,CAAC;IAED,OAAO,GAAG,GAAG,KAAK,SAAS,GAAG,EAAE,CAAC,GAAG,GAAG,cAAc,GAAG,EAAE,CAAC,GAAG,GAAG,SAAS,EAAE,CAAA;AAC9E,CAAC"}
|
||||||
7
node_modules/@actions/core/lib/oidc-utils.d.ts
generated
vendored
Normal file
7
node_modules/@actions/core/lib/oidc-utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export declare class OidcClient {
|
||||||
|
private static createHttpClient;
|
||||||
|
private static getRequestToken;
|
||||||
|
private static getIDTokenUrl;
|
||||||
|
private static getCall;
|
||||||
|
static getIDToken(audience?: string): Promise<string>;
|
||||||
|
}
|
||||||
73
node_modules/@actions/core/lib/oidc-utils.js
generated
vendored
Normal file
73
node_modules/@actions/core/lib/oidc-utils.js
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
import { HttpClient } from '@actions/http-client';
|
||||||
|
import { BearerCredentialHandler } from '@actions/http-client/lib/auth';
|
||||||
|
import { debug, setSecret } from './core.js';
|
||||||
|
export class OidcClient {
|
||||||
|
static createHttpClient(allowRetry = true, maxRetry = 10) {
|
||||||
|
const requestOptions = {
|
||||||
|
allowRetries: allowRetry,
|
||||||
|
maxRetries: maxRetry
|
||||||
|
};
|
||||||
|
return new HttpClient('actions/oidc-client', [new BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
|
||||||
|
}
|
||||||
|
static getRequestToken() {
|
||||||
|
const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
|
||||||
|
if (!token) {
|
||||||
|
throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
|
||||||
|
}
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
static getIDTokenUrl() {
|
||||||
|
const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
|
||||||
|
if (!runtimeUrl) {
|
||||||
|
throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
|
||||||
|
}
|
||||||
|
return runtimeUrl;
|
||||||
|
}
|
||||||
|
static getCall(id_token_url) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
var _a;
|
||||||
|
const httpclient = OidcClient.createHttpClient();
|
||||||
|
const res = yield httpclient
|
||||||
|
.getJson(id_token_url)
|
||||||
|
.catch(error => {
|
||||||
|
throw new Error(`Failed to get ID Token. \n
|
||||||
|
Error Code : ${error.statusCode}\n
|
||||||
|
Error Message: ${error.message}`);
|
||||||
|
});
|
||||||
|
const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
|
||||||
|
if (!id_token) {
|
||||||
|
throw new Error('Response json body do not have ID Token field');
|
||||||
|
}
|
||||||
|
return id_token;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
static getIDToken(audience) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
try {
|
||||||
|
// New ID Token is requested from action service
|
||||||
|
let id_token_url = OidcClient.getIDTokenUrl();
|
||||||
|
if (audience) {
|
||||||
|
const encodedAudience = encodeURIComponent(audience);
|
||||||
|
id_token_url = `${id_token_url}&audience=${encodedAudience}`;
|
||||||
|
}
|
||||||
|
debug(`ID token url is ${id_token_url}`);
|
||||||
|
const id_token = yield OidcClient.getCall(id_token_url);
|
||||||
|
setSecret(id_token);
|
||||||
|
return id_token;
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
throw new Error(`Error message: ${error.message}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=oidc-utils.js.map
|
||||||
1
node_modules/@actions/core/lib/oidc-utils.js.map
generated
vendored
Normal file
1
node_modules/@actions/core/lib/oidc-utils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"oidc-utils.js","sourceRoot":"","sources":["../src/oidc-utils.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAC,uBAAuB,EAAC,MAAM,+BAA+B,CAAA;AACrE,OAAO,EAAC,KAAK,EAAE,SAAS,EAAC,MAAM,WAAW,CAAA;AAK1C,MAAM,OAAO,UAAU;IACb,MAAM,CAAC,gBAAgB,CAC7B,UAAU,GAAG,IAAI,EACjB,QAAQ,GAAG,EAAE;QAEb,MAAM,cAAc,GAAmB;YACrC,YAAY,EAAE,UAAU;YACxB,UAAU,EAAE,QAAQ;SACrB,CAAA;QAED,OAAO,IAAI,UAAU,CACnB,qBAAqB,EACrB,CAAC,IAAI,uBAAuB,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC,EAC3D,cAAc,CACf,CAAA;IACH,CAAC;IAEO,MAAM,CAAC,eAAe;QAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAA;QAC3D,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CACb,2DAA2D,CAC5D,CAAA;QACH,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAEO,MAAM,CAAC,aAAa;QAC1B,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAA;QAC9D,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAA;QAC5E,CAAC;QACD,OAAO,UAAU,CAAA;IACnB,CAAC;IAEO,MAAM,CAAO,OAAO,CAAC,YAAoB;;;YAC/C,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAA;YAEhD,MAAM,GAAG,GAAG,MAAM,UAAU;iBACzB,OAAO,CAAgB,YAAY,CAAC;iBACpC,KAAK,CAAC,KAAK,CAAC,EAAE;gBACb,MAAM,IAAI,KAAK,CACb;uBACa,KAAK,CAAC,UAAU;yBACd,KAAK,CAAC,OAAO,EAAE,CAC/B,CAAA;YACH,CAAC,CAAC,CAAA;YAEJ,MAAM,QAAQ,GAAG,MAAA,GAAG,CAAC,MAAM,0CAAE,KAAK,CAAA;YAClC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;YAClE,CAAC;YACD,OAAO,QAAQ,CAAA;QACjB,CAAC;KAAA;IAED,MAAM,CAAO,UAAU,CAAC,QAAiB;;YACvC,IAAI,CAAC;gBACH,gDAAgD;gBAChD,IAAI,YAAY,GAAW,UAAU,CAAC,aAAa,EAAE,CAAA;gBACrD,IAAI,QAAQ,EAAE,CAAC;oBACb,MAAM,eAAe,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAA;oBACpD,YAAY,GAAG,GAAG,YAAY,aAAa,eAAe,EAAE,CAAA;gBAC9D,CAAC;gBAED,KAAK,CAAC,mBAAmB,YAAY,EAAE,CAAC,CAAA;gBAExC,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;gBACvD,SAAS,CAAC,QAAQ,CAAC,CAAA;gBACnB,OAAO,QAAQ,CAAA;YACjB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,kBAAkB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;YACpD,CAAC;QACH,CAAC;KAAA;CACF"}
|
||||||
25
node_modules/@actions/core/lib/path-utils.d.ts
generated
vendored
Normal file
25
node_modules/@actions/core/lib/path-utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* toPosixPath converts the given path to the posix form. On Windows, \\ will be
|
||||||
|
* replaced with /.
|
||||||
|
*
|
||||||
|
* @param pth. Path to transform.
|
||||||
|
* @return string Posix path.
|
||||||
|
*/
|
||||||
|
export declare function toPosixPath(pth: string): string;
|
||||||
|
/**
|
||||||
|
* toWin32Path converts the given path to the win32 form. On Linux, / will be
|
||||||
|
* replaced with \\.
|
||||||
|
*
|
||||||
|
* @param pth. Path to transform.
|
||||||
|
* @return string Win32 path.
|
||||||
|
*/
|
||||||
|
export declare function toWin32Path(pth: string): string;
|
||||||
|
/**
|
||||||
|
* toPlatformPath converts the given path to a platform-specific path. It does
|
||||||
|
* this by replacing instances of / and \ with the platform-specific path
|
||||||
|
* separator.
|
||||||
|
*
|
||||||
|
* @param pth The path to platformize.
|
||||||
|
* @return string The platform-specific path.
|
||||||
|
*/
|
||||||
|
export declare function toPlatformPath(pth: string): string;
|
||||||
33
node_modules/@actions/core/lib/path-utils.js
generated
vendored
Normal file
33
node_modules/@actions/core/lib/path-utils.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import * as path from 'path';
|
||||||
|
/**
|
||||||
|
* toPosixPath converts the given path to the posix form. On Windows, \\ will be
|
||||||
|
* replaced with /.
|
||||||
|
*
|
||||||
|
* @param pth. Path to transform.
|
||||||
|
* @return string Posix path.
|
||||||
|
*/
|
||||||
|
export function toPosixPath(pth) {
|
||||||
|
return pth.replace(/[\\]/g, '/');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* toWin32Path converts the given path to the win32 form. On Linux, / will be
|
||||||
|
* replaced with \\.
|
||||||
|
*
|
||||||
|
* @param pth. Path to transform.
|
||||||
|
* @return string Win32 path.
|
||||||
|
*/
|
||||||
|
export function toWin32Path(pth) {
|
||||||
|
return pth.replace(/[/]/g, '\\');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* toPlatformPath converts the given path to a platform-specific path. It does
|
||||||
|
* this by replacing instances of / and \ with the platform-specific path
|
||||||
|
* separator.
|
||||||
|
*
|
||||||
|
* @param pth The path to platformize.
|
||||||
|
* @return string The platform-specific path.
|
||||||
|
*/
|
||||||
|
export function toPlatformPath(pth) {
|
||||||
|
return pth.replace(/[/\\]/g, path.sep);
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=path-utils.js.map
|
||||||
1
node_modules/@actions/core/lib/path-utils.js.map
generated
vendored
Normal file
1
node_modules/@actions/core/lib/path-utils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"path-utils.js","sourceRoot":"","sources":["../src/path-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAClC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAClC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,OAAO,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC"}
|
||||||
14
node_modules/@actions/core/lib/platform.d.ts
generated
vendored
Normal file
14
node_modules/@actions/core/lib/platform.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
export declare const platform: NodeJS.Platform;
|
||||||
|
export declare const arch: NodeJS.Architecture;
|
||||||
|
export declare const isWindows: boolean;
|
||||||
|
export declare const isMacOS: boolean;
|
||||||
|
export declare const isLinux: boolean;
|
||||||
|
export declare function getDetails(): Promise<{
|
||||||
|
name: string;
|
||||||
|
platform: string;
|
||||||
|
arch: string;
|
||||||
|
version: string;
|
||||||
|
isWindows: boolean;
|
||||||
|
isMacOS: boolean;
|
||||||
|
isLinux: boolean;
|
||||||
|
}>;
|
||||||
64
node_modules/@actions/core/lib/platform.js
generated
vendored
Normal file
64
node_modules/@actions/core/lib/platform.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
import os from 'os';
|
||||||
|
import * as exec from '@actions/exec';
|
||||||
|
const getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', undefined, {
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
|
const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', undefined, {
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
name: name.trim(),
|
||||||
|
version: version.trim()
|
||||||
|
};
|
||||||
|
});
|
||||||
|
const getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
var _a, _b, _c, _d;
|
||||||
|
const { stdout } = yield exec.getExecOutput('sw_vers', undefined, {
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
|
const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '';
|
||||||
|
const name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : '';
|
||||||
|
return {
|
||||||
|
name,
|
||||||
|
version
|
||||||
|
};
|
||||||
|
});
|
||||||
|
const getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
|
const [name, version] = stdout.trim().split('\n');
|
||||||
|
return {
|
||||||
|
name,
|
||||||
|
version
|
||||||
|
};
|
||||||
|
});
|
||||||
|
export const platform = os.platform();
|
||||||
|
export const arch = os.arch();
|
||||||
|
export const isWindows = platform === 'win32';
|
||||||
|
export const isMacOS = platform === 'darwin';
|
||||||
|
export const isLinux = platform === 'linux';
|
||||||
|
export function getDetails() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return Object.assign(Object.assign({}, (yield (isWindows
|
||||||
|
? getWindowsInfo()
|
||||||
|
: isMacOS
|
||||||
|
? getMacOsInfo()
|
||||||
|
: getLinuxInfo()))), { platform,
|
||||||
|
arch,
|
||||||
|
isWindows,
|
||||||
|
isMacOS,
|
||||||
|
isLinux });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=platform.js.map
|
||||||
1
node_modules/@actions/core/lib/platform.js.map
generated
vendored
Normal file
1
node_modules/@actions/core/lib/platform.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA;AAErC,MAAM,cAAc,GAAG,GAAmD,EAAE;IAC1E,MAAM,EAAC,MAAM,EAAE,OAAO,EAAC,GAAG,MAAM,IAAI,CAAC,aAAa,CAChD,kFAAkF,EAClF,SAAS,EACT;QACE,MAAM,EAAE,IAAI;KACb,CACF,CAAA;IAED,MAAM,EAAC,MAAM,EAAE,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,aAAa,CAC7C,kFAAkF,EAClF,SAAS,EACT;QACE,MAAM,EAAE,IAAI;KACb,CACF,CAAA;IAED,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;QACjB,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE;KACxB,CAAA;AACH,CAAC,CAAA,CAAA;AAED,MAAM,YAAY,GAAG,GAGlB,EAAE;;IACH,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE;QAC9D,MAAM,EAAE,IAAI;KACb,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,MAAA,MAAA,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,0CAAG,CAAC,CAAC,mCAAI,EAAE,CAAA;IACjE,MAAM,IAAI,GAAG,MAAA,MAAA,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,0CAAG,CAAC,CAAC,mCAAI,EAAE,CAAA;IAE3D,OAAO;QACL,IAAI;QACJ,OAAO;KACR,CAAA;AACH,CAAC,CAAA,CAAA;AAED,MAAM,YAAY,GAAG,GAGlB,EAAE;IACH,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;QAC3E,MAAM,EAAE,IAAI;KACb,CAAC,CAAA;IAEF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAEjD,OAAO;QACL,IAAI;QACJ,OAAO;KACR,CAAA;AACH,CAAC,CAAA,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAA;AACrC,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,EAAE,CAAA;AAC7B,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,KAAK,OAAO,CAAA;AAC7C,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,KAAK,QAAQ,CAAA;AAC5C,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,KAAK,OAAO,CAAA;AAE3C,MAAM,UAAgB,UAAU;;QAS9B,uCACK,CAAC,MAAM,CAAC,SAAS;YAClB,CAAC,CAAC,cAAc,EAAE;YAClB,CAAC,CAAC,OAAO;gBACP,CAAC,CAAC,YAAY,EAAE;gBAChB,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,KACtB,QAAQ;YACR,IAAI;YACJ,SAAS;YACT,OAAO;YACP,OAAO,IACR;IACH,CAAC;CAAA"}
|
||||||
202
node_modules/@actions/core/lib/summary.d.ts
generated
vendored
Normal file
202
node_modules/@actions/core/lib/summary.d.ts
generated
vendored
Normal file
@@ -0,0 +1,202 @@
|
|||||||
|
export declare const SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY";
|
||||||
|
export declare const SUMMARY_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";
|
||||||
|
export type SummaryTableRow = (SummaryTableCell | string)[];
|
||||||
|
export interface SummaryTableCell {
|
||||||
|
/**
|
||||||
|
* Cell content
|
||||||
|
*/
|
||||||
|
data: string;
|
||||||
|
/**
|
||||||
|
* Render cell as header
|
||||||
|
* (optional) default: false
|
||||||
|
*/
|
||||||
|
header?: boolean;
|
||||||
|
/**
|
||||||
|
* Number of columns the cell extends
|
||||||
|
* (optional) default: '1'
|
||||||
|
*/
|
||||||
|
colspan?: string;
|
||||||
|
/**
|
||||||
|
* Number of rows the cell extends
|
||||||
|
* (optional) default: '1'
|
||||||
|
*/
|
||||||
|
rowspan?: string;
|
||||||
|
}
|
||||||
|
export interface SummaryImageOptions {
|
||||||
|
/**
|
||||||
|
* The width of the image in pixels. Must be an integer without a unit.
|
||||||
|
* (optional)
|
||||||
|
*/
|
||||||
|
width?: string;
|
||||||
|
/**
|
||||||
|
* The height of the image in pixels. Must be an integer without a unit.
|
||||||
|
* (optional)
|
||||||
|
*/
|
||||||
|
height?: string;
|
||||||
|
}
|
||||||
|
export interface SummaryWriteOptions {
|
||||||
|
/**
|
||||||
|
* Replace all existing content in summary file with buffer contents
|
||||||
|
* (optional) default: false
|
||||||
|
*/
|
||||||
|
overwrite?: boolean;
|
||||||
|
}
|
||||||
|
declare class Summary {
|
||||||
|
private _buffer;
|
||||||
|
private _filePath?;
|
||||||
|
constructor();
|
||||||
|
/**
|
||||||
|
* Finds the summary file path from the environment, rejects if env var is not found or file does not exist
|
||||||
|
* Also checks r/w permissions.
|
||||||
|
*
|
||||||
|
* @returns step summary file path
|
||||||
|
*/
|
||||||
|
private filePath;
|
||||||
|
/**
|
||||||
|
* Wraps content in an HTML tag, adding any HTML attributes
|
||||||
|
*
|
||||||
|
* @param {string} tag HTML tag to wrap
|
||||||
|
* @param {string | null} content content within the tag
|
||||||
|
* @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
|
||||||
|
*
|
||||||
|
* @returns {string} content wrapped in HTML element
|
||||||
|
*/
|
||||||
|
private wrap;
|
||||||
|
/**
|
||||||
|
* Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
|
||||||
|
*
|
||||||
|
* @param {SummaryWriteOptions} [options] (optional) options for write operation
|
||||||
|
*
|
||||||
|
* @returns {Promise<Summary>} summary instance
|
||||||
|
*/
|
||||||
|
write(options?: SummaryWriteOptions): Promise<Summary>;
|
||||||
|
/**
|
||||||
|
* Clears the summary buffer and wipes the summary file
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
clear(): Promise<Summary>;
|
||||||
|
/**
|
||||||
|
* Returns the current summary buffer as a string
|
||||||
|
*
|
||||||
|
* @returns {string} string of summary buffer
|
||||||
|
*/
|
||||||
|
stringify(): string;
|
||||||
|
/**
|
||||||
|
* If the summary buffer is empty
|
||||||
|
*
|
||||||
|
* @returns {boolen} true if the buffer is empty
|
||||||
|
*/
|
||||||
|
isEmptyBuffer(): boolean;
|
||||||
|
/**
|
||||||
|
* Resets the summary buffer without writing to summary file
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
emptyBuffer(): Summary;
|
||||||
|
/**
|
||||||
|
* Adds raw text to the summary buffer
|
||||||
|
*
|
||||||
|
* @param {string} text content to add
|
||||||
|
* @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addRaw(text: string, addEOL?: boolean): Summary;
|
||||||
|
/**
|
||||||
|
* Adds the operating system-specific end-of-line marker to the buffer
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addEOL(): Summary;
|
||||||
|
/**
|
||||||
|
* Adds an HTML codeblock to the summary buffer
|
||||||
|
*
|
||||||
|
* @param {string} code content to render within fenced code block
|
||||||
|
* @param {string} lang (optional) language to syntax highlight code
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addCodeBlock(code: string, lang?: string): Summary;
|
||||||
|
/**
|
||||||
|
* Adds an HTML list to the summary buffer
|
||||||
|
*
|
||||||
|
* @param {string[]} items list of items to render
|
||||||
|
* @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addList(items: string[], ordered?: boolean): Summary;
|
||||||
|
/**
|
||||||
|
* Adds an HTML table to the summary buffer
|
||||||
|
*
|
||||||
|
* @param {SummaryTableCell[]} rows table rows
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addTable(rows: SummaryTableRow[]): Summary;
|
||||||
|
/**
|
||||||
|
* Adds a collapsable HTML details element to the summary buffer
|
||||||
|
*
|
||||||
|
* @param {string} label text for the closed state
|
||||||
|
* @param {string} content collapsable content
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addDetails(label: string, content: string): Summary;
|
||||||
|
/**
|
||||||
|
* Adds an HTML image tag to the summary buffer
|
||||||
|
*
|
||||||
|
* @param {string} src path to the image you to embed
|
||||||
|
* @param {string} alt text description of the image
|
||||||
|
* @param {SummaryImageOptions} options (optional) addition image attributes
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addImage(src: string, alt: string, options?: SummaryImageOptions): Summary;
|
||||||
|
/**
|
||||||
|
* Adds an HTML section heading element
|
||||||
|
*
|
||||||
|
* @param {string} text heading text
|
||||||
|
* @param {number | string} [level=1] (optional) the heading level, default: 1
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addHeading(text: string, level?: number | string): Summary;
|
||||||
|
/**
|
||||||
|
* Adds an HTML thematic break (<hr>) to the summary buffer
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addSeparator(): Summary;
|
||||||
|
/**
|
||||||
|
* Adds an HTML line break (<br>) to the summary buffer
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addBreak(): Summary;
|
||||||
|
/**
|
||||||
|
* Adds an HTML blockquote to the summary buffer
|
||||||
|
*
|
||||||
|
* @param {string} text quote text
|
||||||
|
* @param {string} cite (optional) citation url
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addQuote(text: string, cite?: string): Summary;
|
||||||
|
/**
|
||||||
|
* Adds an HTML anchor tag to the summary buffer
|
||||||
|
*
|
||||||
|
* @param {string} text link text/content
|
||||||
|
* @param {string} href hyperlink
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addLink(text: string, href: string): Summary;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @deprecated use `core.summary`
|
||||||
|
*/
|
||||||
|
export declare const markdownSummary: Summary;
|
||||||
|
export declare const summary: Summary;
|
||||||
|
export {};
|
||||||
280
node_modules/@actions/core/lib/summary.js
generated
vendored
Normal file
280
node_modules/@actions/core/lib/summary.js
generated
vendored
Normal file
@@ -0,0 +1,280 @@
|
|||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
import { EOL } from 'os';
|
||||||
|
import { constants, promises } from 'fs';
|
||||||
|
const { access, appendFile, writeFile } = promises;
|
||||||
|
export const SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
|
||||||
|
export const SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
|
||||||
|
class Summary {
|
||||||
|
constructor() {
|
||||||
|
this._buffer = '';
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Finds the summary file path from the environment, rejects if env var is not found or file does not exist
|
||||||
|
* Also checks r/w permissions.
|
||||||
|
*
|
||||||
|
* @returns step summary file path
|
||||||
|
*/
|
||||||
|
filePath() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if (this._filePath) {
|
||||||
|
return this._filePath;
|
||||||
|
}
|
||||||
|
const pathFromEnv = process.env[SUMMARY_ENV_VAR];
|
||||||
|
if (!pathFromEnv) {
|
||||||
|
throw new Error(`Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
yield access(pathFromEnv, constants.R_OK | constants.W_OK);
|
||||||
|
}
|
||||||
|
catch (_a) {
|
||||||
|
throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
|
||||||
|
}
|
||||||
|
this._filePath = pathFromEnv;
|
||||||
|
return this._filePath;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Wraps content in an HTML tag, adding any HTML attributes
|
||||||
|
*
|
||||||
|
* @param {string} tag HTML tag to wrap
|
||||||
|
* @param {string | null} content content within the tag
|
||||||
|
* @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
|
||||||
|
*
|
||||||
|
* @returns {string} content wrapped in HTML element
|
||||||
|
*/
|
||||||
|
wrap(tag, content, attrs = {}) {
|
||||||
|
const htmlAttrs = Object.entries(attrs)
|
||||||
|
.map(([key, value]) => ` ${key}="${value}"`)
|
||||||
|
.join('');
|
||||||
|
if (!content) {
|
||||||
|
return `<${tag}${htmlAttrs}>`;
|
||||||
|
}
|
||||||
|
return `<${tag}${htmlAttrs}>${content}</${tag}>`;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
|
||||||
|
*
|
||||||
|
* @param {SummaryWriteOptions} [options] (optional) options for write operation
|
||||||
|
*
|
||||||
|
* @returns {Promise<Summary>} summary instance
|
||||||
|
*/
|
||||||
|
write(options) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
|
||||||
|
const filePath = yield this.filePath();
|
||||||
|
const writeFunc = overwrite ? writeFile : appendFile;
|
||||||
|
yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
|
||||||
|
return this.emptyBuffer();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Clears the summary buffer and wipes the summary file
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
clear() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return this.emptyBuffer().write({ overwrite: true });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns the current summary buffer as a string
|
||||||
|
*
|
||||||
|
* @returns {string} string of summary buffer
|
||||||
|
*/
|
||||||
|
stringify() {
|
||||||
|
return this._buffer;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* If the summary buffer is empty
|
||||||
|
*
|
||||||
|
* @returns {boolen} true if the buffer is empty
|
||||||
|
*/
|
||||||
|
isEmptyBuffer() {
|
||||||
|
return this._buffer.length === 0;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Resets the summary buffer without writing to summary file
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
emptyBuffer() {
|
||||||
|
this._buffer = '';
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds raw text to the summary buffer
|
||||||
|
*
|
||||||
|
* @param {string} text content to add
|
||||||
|
* @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addRaw(text, addEOL = false) {
|
||||||
|
this._buffer += text;
|
||||||
|
return addEOL ? this.addEOL() : this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds the operating system-specific end-of-line marker to the buffer
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addEOL() {
|
||||||
|
return this.addRaw(EOL);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds an HTML codeblock to the summary buffer
|
||||||
|
*
|
||||||
|
* @param {string} code content to render within fenced code block
|
||||||
|
* @param {string} lang (optional) language to syntax highlight code
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addCodeBlock(code, lang) {
|
||||||
|
const attrs = Object.assign({}, (lang && { lang }));
|
||||||
|
const element = this.wrap('pre', this.wrap('code', code), attrs);
|
||||||
|
return this.addRaw(element).addEOL();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds an HTML list to the summary buffer
|
||||||
|
*
|
||||||
|
* @param {string[]} items list of items to render
|
||||||
|
* @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addList(items, ordered = false) {
|
||||||
|
const tag = ordered ? 'ol' : 'ul';
|
||||||
|
const listItems = items.map(item => this.wrap('li', item)).join('');
|
||||||
|
const element = this.wrap(tag, listItems);
|
||||||
|
return this.addRaw(element).addEOL();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds an HTML table to the summary buffer
|
||||||
|
*
|
||||||
|
* @param {SummaryTableCell[]} rows table rows
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addTable(rows) {
|
||||||
|
const tableBody = rows
|
||||||
|
.map(row => {
|
||||||
|
const cells = row
|
||||||
|
.map(cell => {
|
||||||
|
if (typeof cell === 'string') {
|
||||||
|
return this.wrap('td', cell);
|
||||||
|
}
|
||||||
|
const { header, data, colspan, rowspan } = cell;
|
||||||
|
const tag = header ? 'th' : 'td';
|
||||||
|
const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
|
||||||
|
return this.wrap(tag, data, attrs);
|
||||||
|
})
|
||||||
|
.join('');
|
||||||
|
return this.wrap('tr', cells);
|
||||||
|
})
|
||||||
|
.join('');
|
||||||
|
const element = this.wrap('table', tableBody);
|
||||||
|
return this.addRaw(element).addEOL();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds a collapsable HTML details element to the summary buffer
|
||||||
|
*
|
||||||
|
* @param {string} label text for the closed state
|
||||||
|
* @param {string} content collapsable content
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addDetails(label, content) {
|
||||||
|
const element = this.wrap('details', this.wrap('summary', label) + content);
|
||||||
|
return this.addRaw(element).addEOL();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds an HTML image tag to the summary buffer
|
||||||
|
*
|
||||||
|
* @param {string} src path to the image you to embed
|
||||||
|
* @param {string} alt text description of the image
|
||||||
|
* @param {SummaryImageOptions} options (optional) addition image attributes
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addImage(src, alt, options) {
|
||||||
|
const { width, height } = options || {};
|
||||||
|
const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
|
||||||
|
const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
|
||||||
|
return this.addRaw(element).addEOL();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds an HTML section heading element
|
||||||
|
*
|
||||||
|
* @param {string} text heading text
|
||||||
|
* @param {number | string} [level=1] (optional) the heading level, default: 1
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addHeading(text, level) {
|
||||||
|
const tag = `h${level}`;
|
||||||
|
const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
|
||||||
|
? tag
|
||||||
|
: 'h1';
|
||||||
|
const element = this.wrap(allowedTag, text);
|
||||||
|
return this.addRaw(element).addEOL();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds an HTML thematic break (<hr>) to the summary buffer
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addSeparator() {
|
||||||
|
const element = this.wrap('hr', null);
|
||||||
|
return this.addRaw(element).addEOL();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds an HTML line break (<br>) to the summary buffer
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addBreak() {
|
||||||
|
const element = this.wrap('br', null);
|
||||||
|
return this.addRaw(element).addEOL();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds an HTML blockquote to the summary buffer
|
||||||
|
*
|
||||||
|
* @param {string} text quote text
|
||||||
|
* @param {string} cite (optional) citation url
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addQuote(text, cite) {
|
||||||
|
const attrs = Object.assign({}, (cite && { cite }));
|
||||||
|
const element = this.wrap('blockquote', text, attrs);
|
||||||
|
return this.addRaw(element).addEOL();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds an HTML anchor tag to the summary buffer
|
||||||
|
*
|
||||||
|
* @param {string} text link text/content
|
||||||
|
* @param {string} href hyperlink
|
||||||
|
*
|
||||||
|
* @returns {Summary} summary instance
|
||||||
|
*/
|
||||||
|
addLink(text, href) {
|
||||||
|
const element = this.wrap('a', text, { href });
|
||||||
|
return this.addRaw(element).addEOL();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const _summary = new Summary();
|
||||||
|
/**
|
||||||
|
* @deprecated use `core.summary`
|
||||||
|
*/
|
||||||
|
export const markdownSummary = _summary;
|
||||||
|
export const summary = _summary;
|
||||||
|
//# sourceMappingURL=summary.js.map
|
||||||
1
node_modules/@actions/core/lib/summary.js.map
generated
vendored
Normal file
1
node_modules/@actions/core/lib/summary.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
14
node_modules/@actions/core/lib/utils.d.ts
generated
vendored
Normal file
14
node_modules/@actions/core/lib/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { AnnotationProperties } from './core.js';
|
||||||
|
import { CommandProperties } from './command.js';
|
||||||
|
/**
|
||||||
|
* Sanitizes an input into a string so it can be passed into issueCommand safely
|
||||||
|
* @param input input to sanitize into a string
|
||||||
|
*/
|
||||||
|
export declare function toCommandValue(input: any): string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param annotationProperties
|
||||||
|
* @returns The command properties to send with the actual annotation command
|
||||||
|
* See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
|
||||||
|
*/
|
||||||
|
export declare function toCommandProperties(annotationProperties: AnnotationProperties): CommandProperties;
|
||||||
35
node_modules/@actions/core/lib/utils.js
generated
vendored
Normal file
35
node_modules/@actions/core/lib/utils.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
// We use any as a valid input type
|
||||||
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
/**
|
||||||
|
* Sanitizes an input into a string so it can be passed into issueCommand safely
|
||||||
|
* @param input input to sanitize into a string
|
||||||
|
*/
|
||||||
|
export function toCommandValue(input) {
|
||||||
|
if (input === null || input === undefined) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
else if (typeof input === 'string' || input instanceof String) {
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
return JSON.stringify(input);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param annotationProperties
|
||||||
|
* @returns The command properties to send with the actual annotation command
|
||||||
|
* See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
|
||||||
|
*/
|
||||||
|
export function toCommandProperties(annotationProperties) {
|
||||||
|
if (!Object.keys(annotationProperties).length) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
title: annotationProperties.title,
|
||||||
|
file: annotationProperties.file,
|
||||||
|
line: annotationProperties.startLine,
|
||||||
|
endLine: annotationProperties.endLine,
|
||||||
|
col: annotationProperties.startColumn,
|
||||||
|
endColumn: annotationProperties.endColumn
|
||||||
|
};
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=utils.js.map
|
||||||
1
node_modules/@actions/core/lib/utils.js.map
generated
vendored
Normal file
1
node_modules/@actions/core/lib/utils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,uDAAuD;AAKvD;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAAU;IACvC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO,EAAE,CAAA;IACX,CAAC;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,EAAE,CAAC;QAChE,OAAO,KAAe,CAAA;IACxB,CAAC;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CACjC,oBAA0C;IAE1C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,MAAM,EAAE,CAAC;QAC9C,OAAO,EAAE,CAAA;IACX,CAAC;IAED,OAAO;QACL,KAAK,EAAE,oBAAoB,CAAC,KAAK;QACjC,IAAI,EAAE,oBAAoB,CAAC,IAAI;QAC/B,IAAI,EAAE,oBAAoB,CAAC,SAAS;QACpC,OAAO,EAAE,oBAAoB,CAAC,OAAO;QACrC,GAAG,EAAE,oBAAoB,CAAC,WAAW;QACrC,SAAS,EAAE,oBAAoB,CAAC,SAAS;KAC1C,CAAA;AACH,CAAC"}
|
||||||
77
node_modules/@actions/core/package.json
generated
vendored
77
node_modules/@actions/core/package.json
generated
vendored
@@ -1,54 +1,31 @@
|
|||||||
{
|
{
|
||||||
"_from": "@actions/core@1.2.3",
|
"name": "@actions/core",
|
||||||
"_id": "@actions/core@1.2.3",
|
"version": "3.0.0",
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-Wp4xnyokakM45Uuj4WLUxdsa8fJjKVl1fDTsPbTEcTcuu0Nb26IPQbOtjmnfaCPGcaoPOOqId8H9NapZ8gii4w==",
|
|
||||||
"_location": "/@actions/core",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "version",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "@actions/core@1.2.3",
|
|
||||||
"name": "@actions/core",
|
|
||||||
"escapedName": "@actions%2fcore",
|
|
||||||
"scope": "@actions",
|
|
||||||
"rawSpec": "1.2.3",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "1.2.3"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"#USER",
|
|
||||||
"/"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.3.tgz",
|
|
||||||
"_shasum": "e844b4fa0820e206075445079130868f95bfca95",
|
|
||||||
"_spec": "@actions/core@1.2.3",
|
|
||||||
"_where": "/home/dawidd6/github/dawidd6/action-send-mail",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/actions/toolkit/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "Actions core lib",
|
"description": "Actions core lib",
|
||||||
"devDependencies": {
|
"keywords": [
|
||||||
"@types/node": "^12.0.2"
|
"github",
|
||||||
|
"actions",
|
||||||
|
"core"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/actions/toolkit/tree/main/packages/core",
|
||||||
|
"license": "MIT",
|
||||||
|
"type": "module",
|
||||||
|
"main": "lib/core.js",
|
||||||
|
"types": "lib/core.d.ts",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"types": "./lib/core.d.ts",
|
||||||
|
"import": "./lib/core.js"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
"lib": "lib",
|
"lib": "lib",
|
||||||
"test": "__tests__"
|
"test": "__tests__"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib",
|
||||||
|
"!.DS_Store"
|
||||||
],
|
],
|
||||||
"homepage": "https://github.com/actions/toolkit/tree/master/packages/core",
|
|
||||||
"keywords": [
|
|
||||||
"github",
|
|
||||||
"actions",
|
|
||||||
"core"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "lib/core.js",
|
|
||||||
"name": "@actions/core",
|
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
@@ -58,10 +35,18 @@
|
|||||||
"directory": "packages/core"
|
"directory": "packages/core"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"audit-moderate": "npm install && npm audit --audit-level=moderate",
|
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
|
||||||
"test": "echo \"Error: run tests from root\" && exit 1",
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||||
"tsc": "tsc"
|
"tsc": "tsc -p tsconfig.json"
|
||||||
},
|
},
|
||||||
"types": "lib/core.d.ts",
|
"bugs": {
|
||||||
"version": "1.2.3"
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@actions/exec": "^3.0.0",
|
||||||
|
"@actions/http-client": "^4.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^25.1.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
9
node_modules/@actions/exec/LICENSE.md
generated
vendored
Normal file
9
node_modules/@actions/exec/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright 2019 GitHub
|
||||||
|
|
||||||
|
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.
|
||||||
57
node_modules/@actions/exec/README.md
generated
vendored
Normal file
57
node_modules/@actions/exec/README.md
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
# `@actions/exec`
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
#### Basic
|
||||||
|
|
||||||
|
You can use this package to execute tools in a cross platform way:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const exec = require('@actions/exec');
|
||||||
|
|
||||||
|
await exec.exec('node index.js');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Args
|
||||||
|
|
||||||
|
You can also pass in arg arrays:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const exec = require('@actions/exec');
|
||||||
|
|
||||||
|
await exec.exec('node', ['index.js', 'foo=bar']);
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Output/options
|
||||||
|
|
||||||
|
Capture output or specify [other options](https://github.com/actions/toolkit/blob/d9347d4ab99fd507c0b9104b2cf79fb44fcc827d/packages/exec/src/interfaces.ts#L5):
|
||||||
|
|
||||||
|
```js
|
||||||
|
const exec = require('@actions/exec');
|
||||||
|
|
||||||
|
let myOutput = '';
|
||||||
|
let myError = '';
|
||||||
|
|
||||||
|
const options = {};
|
||||||
|
options.listeners = {
|
||||||
|
stdout: (data: Buffer) => {
|
||||||
|
myOutput += data.toString();
|
||||||
|
},
|
||||||
|
stderr: (data: Buffer) => {
|
||||||
|
myError += data.toString();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
options.cwd = './lib';
|
||||||
|
|
||||||
|
await exec.exec('node', ['index.js', 'foo=bar'], options);
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Exec tools not in the PATH
|
||||||
|
|
||||||
|
You can specify the full path for tools not in the PATH:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const exec = require('@actions/exec');
|
||||||
|
|
||||||
|
await exec.exec('"/path/to/my-tool"', ['arg1']);
|
||||||
|
```
|
||||||
24
node_modules/@actions/exec/lib/exec.d.ts
generated
vendored
Normal file
24
node_modules/@actions/exec/lib/exec.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import { ExecOptions, ExecOutput, ExecListeners } from './interfaces.js';
|
||||||
|
export { ExecOptions, ExecOutput, ExecListeners };
|
||||||
|
/**
|
||||||
|
* Exec a command.
|
||||||
|
* Output will be streamed to the live console.
|
||||||
|
* Returns promise with return code
|
||||||
|
*
|
||||||
|
* @param commandLine command to execute (can include additional args). Must be correctly escaped.
|
||||||
|
* @param args optional arguments for tool. Escaping is handled by the lib.
|
||||||
|
* @param options optional exec options. See ExecOptions
|
||||||
|
* @returns Promise<number> exit code
|
||||||
|
*/
|
||||||
|
export declare function exec(commandLine: string, args?: string[], options?: ExecOptions): Promise<number>;
|
||||||
|
/**
|
||||||
|
* Exec a command and get the output.
|
||||||
|
* Output will be streamed to the live console.
|
||||||
|
* Returns promise with the exit code and collected stdout and stderr
|
||||||
|
*
|
||||||
|
* @param commandLine command to execute (can include additional args). Must be correctly escaped.
|
||||||
|
* @param args optional arguments for tool. Escaping is handled by the lib.
|
||||||
|
* @param options optional exec options. See ExecOptions
|
||||||
|
* @returns Promise<ExecOutput> exit code, stdout, and stderr
|
||||||
|
*/
|
||||||
|
export declare function getExecOutput(commandLine: string, args?: string[], options?: ExecOptions): Promise<ExecOutput>;
|
||||||
79
node_modules/@actions/exec/lib/exec.js
generated
vendored
Normal file
79
node_modules/@actions/exec/lib/exec.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
import { StringDecoder } from 'string_decoder';
|
||||||
|
import * as tr from './toolrunner.js';
|
||||||
|
/**
|
||||||
|
* Exec a command.
|
||||||
|
* Output will be streamed to the live console.
|
||||||
|
* Returns promise with return code
|
||||||
|
*
|
||||||
|
* @param commandLine command to execute (can include additional args). Must be correctly escaped.
|
||||||
|
* @param args optional arguments for tool. Escaping is handled by the lib.
|
||||||
|
* @param options optional exec options. See ExecOptions
|
||||||
|
* @returns Promise<number> exit code
|
||||||
|
*/
|
||||||
|
export function exec(commandLine, args, options) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const commandArgs = tr.argStringToArray(commandLine);
|
||||||
|
if (commandArgs.length === 0) {
|
||||||
|
throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
|
||||||
|
}
|
||||||
|
// Path to tool to execute should be first arg
|
||||||
|
const toolPath = commandArgs[0];
|
||||||
|
args = commandArgs.slice(1).concat(args || []);
|
||||||
|
const runner = new tr.ToolRunner(toolPath, args, options);
|
||||||
|
return runner.exec();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Exec a command and get the output.
|
||||||
|
* Output will be streamed to the live console.
|
||||||
|
* Returns promise with the exit code and collected stdout and stderr
|
||||||
|
*
|
||||||
|
* @param commandLine command to execute (can include additional args). Must be correctly escaped.
|
||||||
|
* @param args optional arguments for tool. Escaping is handled by the lib.
|
||||||
|
* @param options optional exec options. See ExecOptions
|
||||||
|
* @returns Promise<ExecOutput> exit code, stdout, and stderr
|
||||||
|
*/
|
||||||
|
export function getExecOutput(commandLine, args, options) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
var _a, _b;
|
||||||
|
let stdout = '';
|
||||||
|
let stderr = '';
|
||||||
|
//Using string decoder covers the case where a mult-byte character is split
|
||||||
|
const stdoutDecoder = new StringDecoder('utf8');
|
||||||
|
const stderrDecoder = new StringDecoder('utf8');
|
||||||
|
const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
|
||||||
|
const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
|
||||||
|
const stdErrListener = (data) => {
|
||||||
|
stderr += stderrDecoder.write(data);
|
||||||
|
if (originalStdErrListener) {
|
||||||
|
originalStdErrListener(data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const stdOutListener = (data) => {
|
||||||
|
stdout += stdoutDecoder.write(data);
|
||||||
|
if (originalStdoutListener) {
|
||||||
|
originalStdoutListener(data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
|
||||||
|
const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
|
||||||
|
//flush any remaining characters
|
||||||
|
stdout += stdoutDecoder.end();
|
||||||
|
stderr += stderrDecoder.end();
|
||||||
|
return {
|
||||||
|
exitCode,
|
||||||
|
stdout,
|
||||||
|
stderr
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=exec.js.map
|
||||||
1
node_modules/@actions/exec/lib/exec.js.map
generated
vendored
Normal file
1
node_modules/@actions/exec/lib/exec.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAA;AAE5C,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAIrC;;;;;;;;;GASG;AACH,MAAM,UAAgB,IAAI,CACxB,WAAmB,EACnB,IAAe,EACf,OAAqB;;QAErB,MAAM,WAAW,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAA;QACpD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;QACrE,CAAC;QACD,8CAA8C;QAC9C,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;QAC/B,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA;QAC9C,MAAM,MAAM,GAAkB,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QACxE,OAAO,MAAM,CAAC,IAAI,EAAE,CAAA;IACtB,CAAC;CAAA;AAED;;;;;;;;;GASG;AAEH,MAAM,UAAgB,aAAa,CACjC,WAAmB,EACnB,IAAe,EACf,OAAqB;;;QAErB,IAAI,MAAM,GAAG,EAAE,CAAA;QACf,IAAI,MAAM,GAAG,EAAE,CAAA;QAEf,2EAA2E;QAC3E,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,CAAA;QAC/C,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,CAAA;QAE/C,MAAM,sBAAsB,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,0CAAE,MAAM,CAAA;QACzD,MAAM,sBAAsB,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,0CAAE,MAAM,CAAA;QAEzD,MAAM,cAAc,GAAG,CAAC,IAAY,EAAQ,EAAE;YAC5C,MAAM,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACnC,IAAI,sBAAsB,EAAE,CAAC;gBAC3B,sBAAsB,CAAC,IAAI,CAAC,CAAA;YAC9B,CAAC;QACH,CAAC,CAAA;QAED,MAAM,cAAc,GAAG,CAAC,IAAY,EAAQ,EAAE;YAC5C,MAAM,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACnC,IAAI,sBAAsB,EAAE,CAAC;gBAC3B,sBAAsB,CAAC,IAAI,CAAC,CAAA;YAC9B,CAAC;QACH,CAAC,CAAA;QAED,MAAM,SAAS,mCACV,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,KACrB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,GACvB,CAAA;QAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,IAAI,kCAAM,OAAO,KAAE,SAAS,IAAE,CAAA;QAEvE,gCAAgC;QAChC,MAAM,IAAI,aAAa,CAAC,GAAG,EAAE,CAAA;QAC7B,MAAM,IAAI,aAAa,CAAC,GAAG,EAAE,CAAA;QAE7B,OAAO;YACL,QAAQ;YACR,MAAM;YACN,MAAM;SACP,CAAA;IACH,CAAC;CAAA"}
|
||||||
56
node_modules/@actions/exec/lib/interfaces.d.ts
generated
vendored
Normal file
56
node_modules/@actions/exec/lib/interfaces.d.ts
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
import * as stream from 'stream';
|
||||||
|
/**
|
||||||
|
* Interface for exec options
|
||||||
|
*/
|
||||||
|
export interface ExecOptions {
|
||||||
|
/** optional working directory. defaults to current */
|
||||||
|
cwd?: string;
|
||||||
|
/** optional envvar dictionary. defaults to current process's env */
|
||||||
|
env?: {
|
||||||
|
[key: string]: string;
|
||||||
|
};
|
||||||
|
/** optional. defaults to false */
|
||||||
|
silent?: boolean;
|
||||||
|
/** optional out stream to use. Defaults to process.stdout */
|
||||||
|
outStream?: stream.Writable;
|
||||||
|
/** optional err stream to use. Defaults to process.stderr */
|
||||||
|
errStream?: stream.Writable;
|
||||||
|
/** optional. whether to skip quoting/escaping arguments if needed. defaults to false. */
|
||||||
|
windowsVerbatimArguments?: boolean;
|
||||||
|
/** optional. whether to fail if output to stderr. defaults to false */
|
||||||
|
failOnStdErr?: boolean;
|
||||||
|
/** optional. defaults to failing on non zero. ignore will not fail leaving it up to the caller */
|
||||||
|
ignoreReturnCode?: boolean;
|
||||||
|
/** optional. How long in ms to wait for STDIO streams to close after the exit event of the process before terminating. defaults to 10000 */
|
||||||
|
delay?: number;
|
||||||
|
/** optional. input to write to the process on STDIN. */
|
||||||
|
input?: Buffer;
|
||||||
|
/** optional. Listeners for output. Callback functions that will be called on these events */
|
||||||
|
listeners?: ExecListeners;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Interface for the output of getExecOutput()
|
||||||
|
*/
|
||||||
|
export interface ExecOutput {
|
||||||
|
/**The exit code of the process */
|
||||||
|
exitCode: number;
|
||||||
|
/**The entire stdout of the process as a string */
|
||||||
|
stdout: string;
|
||||||
|
/**The entire stderr of the process as a string */
|
||||||
|
stderr: string;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The user defined listeners for an exec call
|
||||||
|
*/
|
||||||
|
export interface ExecListeners {
|
||||||
|
/** A call back for each buffer of stdout */
|
||||||
|
stdout?: (data: Buffer) => void;
|
||||||
|
/** A call back for each buffer of stderr */
|
||||||
|
stderr?: (data: Buffer) => void;
|
||||||
|
/** A call back for each line of stdout */
|
||||||
|
stdline?: (data: string) => void;
|
||||||
|
/** A call back for each line of stderr */
|
||||||
|
errline?: (data: string) => void;
|
||||||
|
/** A call back for each debug log */
|
||||||
|
debug?: (data: string) => void;
|
||||||
|
}
|
||||||
2
node_modules/@actions/exec/lib/interfaces.js
generated
vendored
Normal file
2
node_modules/@actions/exec/lib/interfaces.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export {};
|
||||||
|
//# sourceMappingURL=interfaces.js.map
|
||||||
1
node_modules/@actions/exec/lib/interfaces.js.map
generated
vendored
Normal file
1
node_modules/@actions/exec/lib/interfaces.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":""}
|
||||||
36
node_modules/@actions/exec/lib/toolrunner.d.ts
generated
vendored
Normal file
36
node_modules/@actions/exec/lib/toolrunner.d.ts
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
import * as events from 'events';
|
||||||
|
import * as im from './interfaces.js';
|
||||||
|
export declare class ToolRunner extends events.EventEmitter {
|
||||||
|
constructor(toolPath: string, args?: string[], options?: im.ExecOptions);
|
||||||
|
private toolPath;
|
||||||
|
private args;
|
||||||
|
private options;
|
||||||
|
private _debug;
|
||||||
|
private _getCommandString;
|
||||||
|
private _processLineBuffer;
|
||||||
|
private _getSpawnFileName;
|
||||||
|
private _getSpawnArgs;
|
||||||
|
private _endsWith;
|
||||||
|
private _isCmdFile;
|
||||||
|
private _windowsQuoteCmdArg;
|
||||||
|
private _uvQuoteCmdArg;
|
||||||
|
private _cloneExecOptions;
|
||||||
|
private _getSpawnOptions;
|
||||||
|
/**
|
||||||
|
* Exec a tool.
|
||||||
|
* Output will be streamed to the live console.
|
||||||
|
* Returns promise with return code
|
||||||
|
*
|
||||||
|
* @param tool path to tool to exec
|
||||||
|
* @param options optional exec options. See ExecOptions
|
||||||
|
* @returns number
|
||||||
|
*/
|
||||||
|
exec(): Promise<number>;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Convert an arg string to an array of args. Handles escaping
|
||||||
|
*
|
||||||
|
* @param argString string of arguments
|
||||||
|
* @returns string[] array of arguments
|
||||||
|
*/
|
||||||
|
export declare function argStringToArray(argString: string): string[];
|
||||||
587
node_modules/@actions/exec/lib/toolrunner.js
generated
vendored
Normal file
587
node_modules/@actions/exec/lib/toolrunner.js
generated
vendored
Normal file
@@ -0,0 +1,587 @@
|
|||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
import * as os from 'os';
|
||||||
|
import * as events from 'events';
|
||||||
|
import * as child from 'child_process';
|
||||||
|
import * as path from 'path';
|
||||||
|
import * as io from '@actions/io';
|
||||||
|
import * as ioUtil from '@actions/io/lib/io-util';
|
||||||
|
import { setTimeout } from 'timers';
|
||||||
|
/* eslint-disable @typescript-eslint/unbound-method */
|
||||||
|
const IS_WINDOWS = process.platform === 'win32';
|
||||||
|
/*
|
||||||
|
* Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
|
||||||
|
*/
|
||||||
|
export class ToolRunner extends events.EventEmitter {
|
||||||
|
constructor(toolPath, args, options) {
|
||||||
|
super();
|
||||||
|
if (!toolPath) {
|
||||||
|
throw new Error("Parameter 'toolPath' cannot be null or empty.");
|
||||||
|
}
|
||||||
|
this.toolPath = toolPath;
|
||||||
|
this.args = args || [];
|
||||||
|
this.options = options || {};
|
||||||
|
}
|
||||||
|
_debug(message) {
|
||||||
|
if (this.options.listeners && this.options.listeners.debug) {
|
||||||
|
this.options.listeners.debug(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_getCommandString(options, noPrefix) {
|
||||||
|
const toolPath = this._getSpawnFileName();
|
||||||
|
const args = this._getSpawnArgs(options);
|
||||||
|
let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
|
||||||
|
if (IS_WINDOWS) {
|
||||||
|
// Windows + cmd file
|
||||||
|
if (this._isCmdFile()) {
|
||||||
|
cmd += toolPath;
|
||||||
|
for (const a of args) {
|
||||||
|
cmd += ` ${a}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Windows + verbatim
|
||||||
|
else if (options.windowsVerbatimArguments) {
|
||||||
|
cmd += `"${toolPath}"`;
|
||||||
|
for (const a of args) {
|
||||||
|
cmd += ` ${a}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Windows (regular)
|
||||||
|
else {
|
||||||
|
cmd += this._windowsQuoteCmdArg(toolPath);
|
||||||
|
for (const a of args) {
|
||||||
|
cmd += ` ${this._windowsQuoteCmdArg(a)}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// OSX/Linux - this can likely be improved with some form of quoting.
|
||||||
|
// creating processes on Unix is fundamentally different than Windows.
|
||||||
|
// on Unix, execvp() takes an arg array.
|
||||||
|
cmd += toolPath;
|
||||||
|
for (const a of args) {
|
||||||
|
cmd += ` ${a}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return cmd;
|
||||||
|
}
|
||||||
|
_processLineBuffer(data, strBuffer, onLine) {
|
||||||
|
try {
|
||||||
|
let s = strBuffer + data.toString();
|
||||||
|
let n = s.indexOf(os.EOL);
|
||||||
|
while (n > -1) {
|
||||||
|
const line = s.substring(0, n);
|
||||||
|
onLine(line);
|
||||||
|
// the rest of the string ...
|
||||||
|
s = s.substring(n + os.EOL.length);
|
||||||
|
n = s.indexOf(os.EOL);
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
// streaming lines to console is best effort. Don't fail a build.
|
||||||
|
this._debug(`error processing line. Failed with error ${err}`);
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_getSpawnFileName() {
|
||||||
|
if (IS_WINDOWS) {
|
||||||
|
if (this._isCmdFile()) {
|
||||||
|
return process.env['COMSPEC'] || 'cmd.exe';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this.toolPath;
|
||||||
|
}
|
||||||
|
_getSpawnArgs(options) {
|
||||||
|
if (IS_WINDOWS) {
|
||||||
|
if (this._isCmdFile()) {
|
||||||
|
let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
|
||||||
|
for (const a of this.args) {
|
||||||
|
argline += ' ';
|
||||||
|
argline += options.windowsVerbatimArguments
|
||||||
|
? a
|
||||||
|
: this._windowsQuoteCmdArg(a);
|
||||||
|
}
|
||||||
|
argline += '"';
|
||||||
|
return [argline];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this.args;
|
||||||
|
}
|
||||||
|
_endsWith(str, end) {
|
||||||
|
return str.endsWith(end);
|
||||||
|
}
|
||||||
|
_isCmdFile() {
|
||||||
|
const upperToolPath = this.toolPath.toUpperCase();
|
||||||
|
return (this._endsWith(upperToolPath, '.CMD') ||
|
||||||
|
this._endsWith(upperToolPath, '.BAT'));
|
||||||
|
}
|
||||||
|
_windowsQuoteCmdArg(arg) {
|
||||||
|
// for .exe, apply the normal quoting rules that libuv applies
|
||||||
|
if (!this._isCmdFile()) {
|
||||||
|
return this._uvQuoteCmdArg(arg);
|
||||||
|
}
|
||||||
|
// otherwise apply quoting rules specific to the cmd.exe command line parser.
|
||||||
|
// the libuv rules are generic and are not designed specifically for cmd.exe
|
||||||
|
// command line parser.
|
||||||
|
//
|
||||||
|
// for a detailed description of the cmd.exe command line parser, refer to
|
||||||
|
// http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
|
||||||
|
// need quotes for empty arg
|
||||||
|
if (!arg) {
|
||||||
|
return '""';
|
||||||
|
}
|
||||||
|
// determine whether the arg needs to be quoted
|
||||||
|
const cmdSpecialChars = [
|
||||||
|
' ',
|
||||||
|
'\t',
|
||||||
|
'&',
|
||||||
|
'(',
|
||||||
|
')',
|
||||||
|
'[',
|
||||||
|
']',
|
||||||
|
'{',
|
||||||
|
'}',
|
||||||
|
'^',
|
||||||
|
'=',
|
||||||
|
';',
|
||||||
|
'!',
|
||||||
|
"'",
|
||||||
|
'+',
|
||||||
|
',',
|
||||||
|
'`',
|
||||||
|
'~',
|
||||||
|
'|',
|
||||||
|
'<',
|
||||||
|
'>',
|
||||||
|
'"'
|
||||||
|
];
|
||||||
|
let needsQuotes = false;
|
||||||
|
for (const char of arg) {
|
||||||
|
if (cmdSpecialChars.some(x => x === char)) {
|
||||||
|
needsQuotes = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// short-circuit if quotes not needed
|
||||||
|
if (!needsQuotes) {
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
// the following quoting rules are very similar to the rules that by libuv applies.
|
||||||
|
//
|
||||||
|
// 1) wrap the string in quotes
|
||||||
|
//
|
||||||
|
// 2) double-up quotes - i.e. " => ""
|
||||||
|
//
|
||||||
|
// this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
|
||||||
|
// doesn't work well with a cmd.exe command line.
|
||||||
|
//
|
||||||
|
// note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
|
||||||
|
// for example, the command line:
|
||||||
|
// foo.exe "myarg:""my val"""
|
||||||
|
// is parsed by a .NET console app into an arg array:
|
||||||
|
// [ "myarg:\"my val\"" ]
|
||||||
|
// which is the same end result when applying libuv quoting rules. although the actual
|
||||||
|
// command line from libuv quoting rules would look like:
|
||||||
|
// foo.exe "myarg:\"my val\""
|
||||||
|
//
|
||||||
|
// 3) double-up slashes that precede a quote,
|
||||||
|
// e.g. hello \world => "hello \world"
|
||||||
|
// hello\"world => "hello\\""world"
|
||||||
|
// hello\\"world => "hello\\\\""world"
|
||||||
|
// hello world\ => "hello world\\"
|
||||||
|
//
|
||||||
|
// technically this is not required for a cmd.exe command line, or the batch argument parser.
|
||||||
|
// the reasons for including this as a .cmd quoting rule are:
|
||||||
|
//
|
||||||
|
// a) this is optimized for the scenario where the argument is passed from the .cmd file to an
|
||||||
|
// external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
|
||||||
|
//
|
||||||
|
// b) it's what we've been doing previously (by deferring to node default behavior) and we
|
||||||
|
// haven't heard any complaints about that aspect.
|
||||||
|
//
|
||||||
|
// note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
|
||||||
|
// escaped when used on the command line directly - even though within a .cmd file % can be escaped
|
||||||
|
// by using %%.
|
||||||
|
//
|
||||||
|
// the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
|
||||||
|
// the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
|
||||||
|
//
|
||||||
|
// one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
|
||||||
|
// often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
|
||||||
|
// variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
|
||||||
|
// to an external program.
|
||||||
|
//
|
||||||
|
// an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
|
||||||
|
// % can be escaped within a .cmd file.
|
||||||
|
let reverse = '"';
|
||||||
|
let quoteHit = true;
|
||||||
|
for (let i = arg.length; i > 0; i--) {
|
||||||
|
// walk the string in reverse
|
||||||
|
reverse += arg[i - 1];
|
||||||
|
if (quoteHit && arg[i - 1] === '\\') {
|
||||||
|
reverse += '\\'; // double the slash
|
||||||
|
}
|
||||||
|
else if (arg[i - 1] === '"') {
|
||||||
|
quoteHit = true;
|
||||||
|
reverse += '"'; // double the quote
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
quoteHit = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reverse += '"';
|
||||||
|
return reverse.split('').reverse().join('');
|
||||||
|
}
|
||||||
|
_uvQuoteCmdArg(arg) {
|
||||||
|
// Tool runner wraps child_process.spawn() and needs to apply the same quoting as
|
||||||
|
// Node in certain cases where the undocumented spawn option windowsVerbatimArguments
|
||||||
|
// is used.
|
||||||
|
//
|
||||||
|
// Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
|
||||||
|
// see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
|
||||||
|
// pasting copyright notice from Node within this function:
|
||||||
|
//
|
||||||
|
// Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
||||||
|
//
|
||||||
|
// 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.
|
||||||
|
if (!arg) {
|
||||||
|
// Need double quotation for empty argument
|
||||||
|
return '""';
|
||||||
|
}
|
||||||
|
if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
|
||||||
|
// No quotation needed
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
if (!arg.includes('"') && !arg.includes('\\')) {
|
||||||
|
// No embedded double quotes or backslashes, so I can just wrap
|
||||||
|
// quote marks around the whole thing.
|
||||||
|
return `"${arg}"`;
|
||||||
|
}
|
||||||
|
// Expected input/output:
|
||||||
|
// input : hello"world
|
||||||
|
// output: "hello\"world"
|
||||||
|
// input : hello""world
|
||||||
|
// output: "hello\"\"world"
|
||||||
|
// input : hello\world
|
||||||
|
// output: hello\world
|
||||||
|
// input : hello\\world
|
||||||
|
// output: hello\\world
|
||||||
|
// input : hello\"world
|
||||||
|
// output: "hello\\\"world"
|
||||||
|
// input : hello\\"world
|
||||||
|
// output: "hello\\\\\"world"
|
||||||
|
// input : hello world\
|
||||||
|
// output: "hello world\\" - note the comment in libuv actually reads "hello world\"
|
||||||
|
// but it appears the comment is wrong, it should be "hello world\\"
|
||||||
|
let reverse = '"';
|
||||||
|
let quoteHit = true;
|
||||||
|
for (let i = arg.length; i > 0; i--) {
|
||||||
|
// walk the string in reverse
|
||||||
|
reverse += arg[i - 1];
|
||||||
|
if (quoteHit && arg[i - 1] === '\\') {
|
||||||
|
reverse += '\\';
|
||||||
|
}
|
||||||
|
else if (arg[i - 1] === '"') {
|
||||||
|
quoteHit = true;
|
||||||
|
reverse += '\\';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
quoteHit = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reverse += '"';
|
||||||
|
return reverse.split('').reverse().join('');
|
||||||
|
}
|
||||||
|
_cloneExecOptions(options) {
|
||||||
|
options = options || {};
|
||||||
|
const result = {
|
||||||
|
cwd: options.cwd || process.cwd(),
|
||||||
|
env: options.env || process.env,
|
||||||
|
silent: options.silent || false,
|
||||||
|
windowsVerbatimArguments: options.windowsVerbatimArguments || false,
|
||||||
|
failOnStdErr: options.failOnStdErr || false,
|
||||||
|
ignoreReturnCode: options.ignoreReturnCode || false,
|
||||||
|
delay: options.delay || 10000
|
||||||
|
};
|
||||||
|
result.outStream = options.outStream || process.stdout;
|
||||||
|
result.errStream = options.errStream || process.stderr;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
_getSpawnOptions(options, toolPath) {
|
||||||
|
options = options || {};
|
||||||
|
const result = {};
|
||||||
|
result.cwd = options.cwd;
|
||||||
|
result.env = options.env;
|
||||||
|
result['windowsVerbatimArguments'] =
|
||||||
|
options.windowsVerbatimArguments || this._isCmdFile();
|
||||||
|
if (options.windowsVerbatimArguments) {
|
||||||
|
result.argv0 = `"${toolPath}"`;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Exec a tool.
|
||||||
|
* Output will be streamed to the live console.
|
||||||
|
* Returns promise with return code
|
||||||
|
*
|
||||||
|
* @param tool path to tool to exec
|
||||||
|
* @param options optional exec options. See ExecOptions
|
||||||
|
* @returns number
|
||||||
|
*/
|
||||||
|
exec() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
// root the tool path if it is unrooted and contains relative pathing
|
||||||
|
if (!ioUtil.isRooted(this.toolPath) &&
|
||||||
|
(this.toolPath.includes('/') ||
|
||||||
|
(IS_WINDOWS && this.toolPath.includes('\\')))) {
|
||||||
|
// prefer options.cwd if it is specified, however options.cwd may also need to be rooted
|
||||||
|
this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
|
||||||
|
}
|
||||||
|
// if the tool is only a file name, then resolve it from the PATH
|
||||||
|
// otherwise verify it exists (add extension on Windows if necessary)
|
||||||
|
this.toolPath = yield io.which(this.toolPath, true);
|
||||||
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
||||||
|
this._debug(`exec tool: ${this.toolPath}`);
|
||||||
|
this._debug('arguments:');
|
||||||
|
for (const arg of this.args) {
|
||||||
|
this._debug(` ${arg}`);
|
||||||
|
}
|
||||||
|
const optionsNonNull = this._cloneExecOptions(this.options);
|
||||||
|
if (!optionsNonNull.silent && optionsNonNull.outStream) {
|
||||||
|
optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
|
||||||
|
}
|
||||||
|
const state = new ExecState(optionsNonNull, this.toolPath);
|
||||||
|
state.on('debug', (message) => {
|
||||||
|
this._debug(message);
|
||||||
|
});
|
||||||
|
if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {
|
||||||
|
return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
|
||||||
|
}
|
||||||
|
const fileName = this._getSpawnFileName();
|
||||||
|
const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
|
||||||
|
let stdbuffer = '';
|
||||||
|
if (cp.stdout) {
|
||||||
|
cp.stdout.on('data', (data) => {
|
||||||
|
if (this.options.listeners && this.options.listeners.stdout) {
|
||||||
|
this.options.listeners.stdout(data);
|
||||||
|
}
|
||||||
|
if (!optionsNonNull.silent && optionsNonNull.outStream) {
|
||||||
|
optionsNonNull.outStream.write(data);
|
||||||
|
}
|
||||||
|
stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {
|
||||||
|
if (this.options.listeners && this.options.listeners.stdline) {
|
||||||
|
this.options.listeners.stdline(line);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
let errbuffer = '';
|
||||||
|
if (cp.stderr) {
|
||||||
|
cp.stderr.on('data', (data) => {
|
||||||
|
state.processStderr = true;
|
||||||
|
if (this.options.listeners && this.options.listeners.stderr) {
|
||||||
|
this.options.listeners.stderr(data);
|
||||||
|
}
|
||||||
|
if (!optionsNonNull.silent &&
|
||||||
|
optionsNonNull.errStream &&
|
||||||
|
optionsNonNull.outStream) {
|
||||||
|
const s = optionsNonNull.failOnStdErr
|
||||||
|
? optionsNonNull.errStream
|
||||||
|
: optionsNonNull.outStream;
|
||||||
|
s.write(data);
|
||||||
|
}
|
||||||
|
errbuffer = this._processLineBuffer(data, errbuffer, (line) => {
|
||||||
|
if (this.options.listeners && this.options.listeners.errline) {
|
||||||
|
this.options.listeners.errline(line);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
cp.on('error', (err) => {
|
||||||
|
state.processError = err.message;
|
||||||
|
state.processExited = true;
|
||||||
|
state.processClosed = true;
|
||||||
|
state.CheckComplete();
|
||||||
|
});
|
||||||
|
cp.on('exit', (code) => {
|
||||||
|
state.processExitCode = code;
|
||||||
|
state.processExited = true;
|
||||||
|
this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
|
||||||
|
state.CheckComplete();
|
||||||
|
});
|
||||||
|
cp.on('close', (code) => {
|
||||||
|
state.processExitCode = code;
|
||||||
|
state.processExited = true;
|
||||||
|
state.processClosed = true;
|
||||||
|
this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
|
||||||
|
state.CheckComplete();
|
||||||
|
});
|
||||||
|
state.on('done', (error, exitCode) => {
|
||||||
|
if (stdbuffer.length > 0) {
|
||||||
|
this.emit('stdline', stdbuffer);
|
||||||
|
}
|
||||||
|
if (errbuffer.length > 0) {
|
||||||
|
this.emit('errline', errbuffer);
|
||||||
|
}
|
||||||
|
cp.removeAllListeners();
|
||||||
|
if (error) {
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(exitCode);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (this.options.input) {
|
||||||
|
if (!cp.stdin) {
|
||||||
|
throw new Error('child process missing stdin');
|
||||||
|
}
|
||||||
|
cp.stdin.end(this.options.input);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Convert an arg string to an array of args. Handles escaping
|
||||||
|
*
|
||||||
|
* @param argString string of arguments
|
||||||
|
* @returns string[] array of arguments
|
||||||
|
*/
|
||||||
|
export function argStringToArray(argString) {
|
||||||
|
const args = [];
|
||||||
|
let inQuotes = false;
|
||||||
|
let escaped = false;
|
||||||
|
let arg = '';
|
||||||
|
function append(c) {
|
||||||
|
// we only escape double quotes.
|
||||||
|
if (escaped && c !== '"') {
|
||||||
|
arg += '\\';
|
||||||
|
}
|
||||||
|
arg += c;
|
||||||
|
escaped = false;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < argString.length; i++) {
|
||||||
|
const c = argString.charAt(i);
|
||||||
|
if (c === '"') {
|
||||||
|
if (!escaped) {
|
||||||
|
inQuotes = !inQuotes;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
append(c);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (c === '\\' && escaped) {
|
||||||
|
append(c);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (c === '\\' && inQuotes) {
|
||||||
|
escaped = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (c === ' ' && !inQuotes) {
|
||||||
|
if (arg.length > 0) {
|
||||||
|
args.push(arg);
|
||||||
|
arg = '';
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
append(c);
|
||||||
|
}
|
||||||
|
if (arg.length > 0) {
|
||||||
|
args.push(arg.trim());
|
||||||
|
}
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
class ExecState extends events.EventEmitter {
|
||||||
|
constructor(options, toolPath) {
|
||||||
|
super();
|
||||||
|
this.processClosed = false; // tracks whether the process has exited and stdio is closed
|
||||||
|
this.processError = '';
|
||||||
|
this.processExitCode = 0;
|
||||||
|
this.processExited = false; // tracks whether the process has exited
|
||||||
|
this.processStderr = false; // tracks whether stderr was written to
|
||||||
|
this.delay = 10000; // 10 seconds
|
||||||
|
this.done = false;
|
||||||
|
this.timeout = null;
|
||||||
|
if (!toolPath) {
|
||||||
|
throw new Error('toolPath must not be empty');
|
||||||
|
}
|
||||||
|
this.options = options;
|
||||||
|
this.toolPath = toolPath;
|
||||||
|
if (options.delay) {
|
||||||
|
this.delay = options.delay;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CheckComplete() {
|
||||||
|
if (this.done) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.processClosed) {
|
||||||
|
this._setResult();
|
||||||
|
}
|
||||||
|
else if (this.processExited) {
|
||||||
|
this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_debug(message) {
|
||||||
|
this.emit('debug', message);
|
||||||
|
}
|
||||||
|
_setResult() {
|
||||||
|
// determine whether there is an error
|
||||||
|
let error;
|
||||||
|
if (this.processExited) {
|
||||||
|
if (this.processError) {
|
||||||
|
error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
|
||||||
|
}
|
||||||
|
else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
|
||||||
|
error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
|
||||||
|
}
|
||||||
|
else if (this.processStderr && this.options.failOnStdErr) {
|
||||||
|
error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// clear the timeout
|
||||||
|
if (this.timeout) {
|
||||||
|
clearTimeout(this.timeout);
|
||||||
|
this.timeout = null;
|
||||||
|
}
|
||||||
|
this.done = true;
|
||||||
|
this.emit('done', error, this.processExitCode);
|
||||||
|
}
|
||||||
|
static HandleTimeout(state) {
|
||||||
|
if (state.done) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!state.processClosed && state.processExited) {
|
||||||
|
const message = `The STDIO streams did not close within ${state.delay / 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
|
||||||
|
state._debug(message);
|
||||||
|
}
|
||||||
|
state._setResult();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=toolrunner.js.map
|
||||||
1
node_modules/@actions/exec/lib/toolrunner.js.map
generated
vendored
Normal file
1
node_modules/@actions/exec/lib/toolrunner.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
48
node_modules/@actions/exec/package.json
generated
vendored
Normal file
48
node_modules/@actions/exec/package.json
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"name": "@actions/exec",
|
||||||
|
"version": "3.0.0",
|
||||||
|
"description": "Actions exec lib",
|
||||||
|
"keywords": [
|
||||||
|
"github",
|
||||||
|
"actions",
|
||||||
|
"exec"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/actions/toolkit/tree/main/packages/exec",
|
||||||
|
"license": "MIT",
|
||||||
|
"type": "module",
|
||||||
|
"main": "lib/exec.js",
|
||||||
|
"types": "lib/exec.d.ts",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"types": "./lib/exec.d.ts",
|
||||||
|
"import": "./lib/exec.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"lib": "lib",
|
||||||
|
"test": "__tests__"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"lib",
|
||||||
|
"!.DS_Store"
|
||||||
|
],
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/actions/toolkit.git",
|
||||||
|
"directory": "packages/exec"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
|
||||||
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||||
|
"tsc": "tsc"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@actions/io": "^3.0.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
9
node_modules/@actions/glob/LICENSE.md
generated
vendored
Normal file
9
node_modules/@actions/glob/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright 2019 GitHub
|
||||||
|
|
||||||
|
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.
|
||||||
113
node_modules/@actions/glob/README.md
generated
vendored
Normal file
113
node_modules/@actions/glob/README.md
generated
vendored
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
# `@actions/glob`
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### Basic
|
||||||
|
|
||||||
|
You can use this package to search for files matching glob patterns.
|
||||||
|
|
||||||
|
Relative paths and absolute paths are both allowed. Relative paths are rooted against the current working directory.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const glob = require('@actions/glob');
|
||||||
|
|
||||||
|
const patterns = ['**/tar.gz', '**/tar.bz']
|
||||||
|
const globber = await glob.create(patterns.join('\n'))
|
||||||
|
const files = await globber.glob()
|
||||||
|
```
|
||||||
|
|
||||||
|
### Opt out of following symbolic links
|
||||||
|
|
||||||
|
```js
|
||||||
|
const glob = require('@actions/glob');
|
||||||
|
|
||||||
|
const globber = await glob.create('**', {followSymbolicLinks: false})
|
||||||
|
const files = await globber.glob()
|
||||||
|
```
|
||||||
|
|
||||||
|
### Iterator
|
||||||
|
|
||||||
|
When dealing with a large amount of results, consider iterating the results as they are returned:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const glob = require('@actions/glob');
|
||||||
|
|
||||||
|
const globber = await glob.create('**')
|
||||||
|
for await (const file of globber.globGenerator()) {
|
||||||
|
console.log(file)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Recommended action inputs
|
||||||
|
|
||||||
|
Glob follows symbolic links by default. Following is often appropriate unless deleting files.
|
||||||
|
|
||||||
|
Users may want to opt-out from following symbolic links for other reasons. For example,
|
||||||
|
excessive amounts of symbolic links can create the appearance of very, very many files
|
||||||
|
and slow the search.
|
||||||
|
|
||||||
|
When an action allows a user to specify input patterns, it is generally recommended to
|
||||||
|
allow users to opt-out from following symbolic links.
|
||||||
|
|
||||||
|
Snippet from `action.yml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
inputs:
|
||||||
|
files:
|
||||||
|
description: 'Files to print'
|
||||||
|
required: true
|
||||||
|
follow-symbolic-links:
|
||||||
|
description: 'Indicates whether to follow symbolic links'
|
||||||
|
default: true
|
||||||
|
```
|
||||||
|
|
||||||
|
And corresponding toolkit consumption:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const core = require('@actions/core')
|
||||||
|
const glob = require('@actions/glob')
|
||||||
|
|
||||||
|
const globOptions = {
|
||||||
|
followSymbolicLinks: core.getInput('follow-symbolic-links').toUpper() !== 'FALSE'
|
||||||
|
}
|
||||||
|
const globber = glob.create(core.getInput('files'), globOptions)
|
||||||
|
for await (const file of globber.globGenerator()) {
|
||||||
|
console.log(file)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Patterns
|
||||||
|
|
||||||
|
### Glob behavior
|
||||||
|
|
||||||
|
Patterns `*`, `?`, `[...]`, `**` (globstar) are supported.
|
||||||
|
|
||||||
|
With the following behaviors:
|
||||||
|
- File names that begin with `.` may be included in the results
|
||||||
|
- Case insensitive on Windows
|
||||||
|
- Directory separator `/` and `\` both supported on Windows
|
||||||
|
|
||||||
|
### Tilde expansion
|
||||||
|
|
||||||
|
Supports basic tilde expansion, for current user HOME replacement only.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
- `~` may expand to /Users/johndoe
|
||||||
|
- `~/foo` may expand to /Users/johndoe/foo
|
||||||
|
|
||||||
|
### Comments
|
||||||
|
|
||||||
|
Patterns that begin with `#` are treated as comments.
|
||||||
|
|
||||||
|
### Exclude patterns
|
||||||
|
|
||||||
|
Leading `!` changes the meaning of an include pattern to exclude.
|
||||||
|
|
||||||
|
Multiple leading `!` flips the meaning.
|
||||||
|
|
||||||
|
### Escaping
|
||||||
|
|
||||||
|
Wrapping special characters in `[]` can be used to escape literal glob characters
|
||||||
|
in a file name. For example the literal file name `hello[a-z]` can be escaped as `hello[[]a-z]`.
|
||||||
|
|
||||||
|
On Linux/macOS `\` is also treated as an escape character.
|
||||||
20
node_modules/@actions/glob/lib/glob.d.ts
generated
vendored
Normal file
20
node_modules/@actions/glob/lib/glob.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import { Globber } from './internal-globber.js';
|
||||||
|
import { GlobOptions } from './internal-glob-options.js';
|
||||||
|
import { HashFileOptions } from './internal-hash-file-options.js';
|
||||||
|
export { Globber, GlobOptions };
|
||||||
|
/**
|
||||||
|
* Constructs a globber
|
||||||
|
*
|
||||||
|
* @param patterns Patterns separated by newlines
|
||||||
|
* @param options Glob options
|
||||||
|
*/
|
||||||
|
export declare function create(patterns: string, options?: GlobOptions): Promise<Globber>;
|
||||||
|
/**
|
||||||
|
* Computes the sha256 hash of a glob
|
||||||
|
*
|
||||||
|
* @param patterns Patterns separated by newlines
|
||||||
|
* @param currentWorkspace Workspace used when matching files
|
||||||
|
* @param options Glob options
|
||||||
|
* @param verbose Enables verbose logging
|
||||||
|
*/
|
||||||
|
export declare function hashFiles(patterns: string, currentWorkspace?: string, options?: HashFileOptions, verbose?: Boolean): Promise<string>;
|
||||||
41
node_modules/@actions/glob/lib/glob.js
generated
vendored
Normal file
41
node_modules/@actions/glob/lib/glob.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
import { DefaultGlobber } from './internal-globber.js';
|
||||||
|
import { hashFiles as _hashFiles } from './internal-hash-files.js';
|
||||||
|
/**
|
||||||
|
* Constructs a globber
|
||||||
|
*
|
||||||
|
* @param patterns Patterns separated by newlines
|
||||||
|
* @param options Glob options
|
||||||
|
*/
|
||||||
|
export function create(patterns, options) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return yield DefaultGlobber.create(patterns, options);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Computes the sha256 hash of a glob
|
||||||
|
*
|
||||||
|
* @param patterns Patterns separated by newlines
|
||||||
|
* @param currentWorkspace Workspace used when matching files
|
||||||
|
* @param options Glob options
|
||||||
|
* @param verbose Enables verbose logging
|
||||||
|
*/
|
||||||
|
export function hashFiles(patterns_1) {
|
||||||
|
return __awaiter(this, arguments, void 0, function* (patterns, currentWorkspace = '', options, verbose = false) {
|
||||||
|
let followSymbolicLinks = true;
|
||||||
|
if (options && typeof options.followSymbolicLinks === 'boolean') {
|
||||||
|
followSymbolicLinks = options.followSymbolicLinks;
|
||||||
|
}
|
||||||
|
const globber = yield create(patterns, { followSymbolicLinks });
|
||||||
|
return _hashFiles(globber, currentWorkspace, verbose);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=glob.js.map
|
||||||
1
node_modules/@actions/glob/lib/glob.js.map
generated
vendored
Normal file
1
node_modules/@actions/glob/lib/glob.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../src/glob.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAU,cAAc,EAAC,MAAM,uBAAuB,CAAA;AAG7D,OAAO,EAAC,SAAS,IAAI,UAAU,EAAC,MAAM,0BAA0B,CAAA;AAIhE;;;;;GAKG;AACH,MAAM,UAAgB,MAAM,CAC1B,QAAgB,EAChB,OAAqB;;QAErB,OAAO,MAAM,cAAc,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IACvD,CAAC;CAAA;AAED;;;;;;;GAOG;AACH,MAAM,UAAgB,SAAS;yDAC7B,QAAgB,EAChB,gBAAgB,GAAG,EAAE,EACrB,OAAyB,EACzB,UAAmB,KAAK;QAExB,IAAI,mBAAmB,GAAG,IAAI,CAAA;QAC9B,IAAI,OAAO,IAAI,OAAO,OAAO,CAAC,mBAAmB,KAAK,SAAS,EAAE,CAAC;YAChE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAA;QACnD,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,QAAQ,EAAE,EAAC,mBAAmB,EAAC,CAAC,CAAA;QAC7D,OAAO,UAAU,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAA;IACvD,CAAC;CAAA"}
|
||||||
5
node_modules/@actions/glob/lib/internal-glob-options-helper.d.ts
generated
vendored
Normal file
5
node_modules/@actions/glob/lib/internal-glob-options-helper.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import { GlobOptions } from './internal-glob-options.js';
|
||||||
|
/**
|
||||||
|
* Returns a copy with defaults filled in.
|
||||||
|
*/
|
||||||
|
export declare function getOptions(copy?: GlobOptions): GlobOptions;
|
||||||
37
node_modules/@actions/glob/lib/internal-glob-options-helper.js
generated
vendored
Normal file
37
node_modules/@actions/glob/lib/internal-glob-options-helper.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import * as core from '@actions/core';
|
||||||
|
/**
|
||||||
|
* Returns a copy with defaults filled in.
|
||||||
|
*/
|
||||||
|
export function getOptions(copy) {
|
||||||
|
const result = {
|
||||||
|
followSymbolicLinks: true,
|
||||||
|
implicitDescendants: true,
|
||||||
|
matchDirectories: true,
|
||||||
|
omitBrokenSymbolicLinks: true,
|
||||||
|
excludeHiddenFiles: false
|
||||||
|
};
|
||||||
|
if (copy) {
|
||||||
|
if (typeof copy.followSymbolicLinks === 'boolean') {
|
||||||
|
result.followSymbolicLinks = copy.followSymbolicLinks;
|
||||||
|
core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`);
|
||||||
|
}
|
||||||
|
if (typeof copy.implicitDescendants === 'boolean') {
|
||||||
|
result.implicitDescendants = copy.implicitDescendants;
|
||||||
|
core.debug(`implicitDescendants '${result.implicitDescendants}'`);
|
||||||
|
}
|
||||||
|
if (typeof copy.matchDirectories === 'boolean') {
|
||||||
|
result.matchDirectories = copy.matchDirectories;
|
||||||
|
core.debug(`matchDirectories '${result.matchDirectories}'`);
|
||||||
|
}
|
||||||
|
if (typeof copy.omitBrokenSymbolicLinks === 'boolean') {
|
||||||
|
result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks;
|
||||||
|
core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`);
|
||||||
|
}
|
||||||
|
if (typeof copy.excludeHiddenFiles === 'boolean') {
|
||||||
|
result.excludeHiddenFiles = copy.excludeHiddenFiles;
|
||||||
|
core.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=internal-glob-options-helper.js.map
|
||||||
1
node_modules/@actions/glob/lib/internal-glob-options-helper.js.map
generated
vendored
Normal file
1
node_modules/@actions/glob/lib/internal-glob-options-helper.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"internal-glob-options-helper.js","sourceRoot":"","sources":["../src/internal-glob-options-helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA;AAGrC;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAkB;IAC3C,MAAM,MAAM,GAAgB;QAC1B,mBAAmB,EAAE,IAAI;QACzB,mBAAmB,EAAE,IAAI;QACzB,gBAAgB,EAAE,IAAI;QACtB,uBAAuB,EAAE,IAAI;QAC7B,kBAAkB,EAAE,KAAK;KAC1B,CAAA;IAED,IAAI,IAAI,EAAE,CAAC;QACT,IAAI,OAAO,IAAI,CAAC,mBAAmB,KAAK,SAAS,EAAE,CAAC;YAClD,MAAM,CAAC,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAA;YACrD,IAAI,CAAC,KAAK,CAAC,wBAAwB,MAAM,CAAC,mBAAmB,GAAG,CAAC,CAAA;QACnE,CAAC;QAED,IAAI,OAAO,IAAI,CAAC,mBAAmB,KAAK,SAAS,EAAE,CAAC;YAClD,MAAM,CAAC,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAA;YACrD,IAAI,CAAC,KAAK,CAAC,wBAAwB,MAAM,CAAC,mBAAmB,GAAG,CAAC,CAAA;QACnE,CAAC;QAED,IAAI,OAAO,IAAI,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;YAC/C,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAA;YAC/C,IAAI,CAAC,KAAK,CAAC,qBAAqB,MAAM,CAAC,gBAAgB,GAAG,CAAC,CAAA;QAC7D,CAAC;QAED,IAAI,OAAO,IAAI,CAAC,uBAAuB,KAAK,SAAS,EAAE,CAAC;YACtD,MAAM,CAAC,uBAAuB,GAAG,IAAI,CAAC,uBAAuB,CAAA;YAC7D,IAAI,CAAC,KAAK,CAAC,4BAA4B,MAAM,CAAC,uBAAuB,GAAG,CAAC,CAAA;QAC3E,CAAC;QAED,IAAI,OAAO,IAAI,CAAC,kBAAkB,KAAK,SAAS,EAAE,CAAC;YACjD,MAAM,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAA;YACnD,IAAI,CAAC,KAAK,CAAC,uBAAuB,MAAM,CAAC,kBAAkB,GAAG,CAAC,CAAA;QACjE,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
||||||
44
node_modules/@actions/glob/lib/internal-glob-options.d.ts
generated
vendored
Normal file
44
node_modules/@actions/glob/lib/internal-glob-options.d.ts
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
/**
|
||||||
|
* Options to control globbing behavior
|
||||||
|
*/
|
||||||
|
export interface GlobOptions {
|
||||||
|
/**
|
||||||
|
* Indicates whether to follow symbolic links. Generally should set to false
|
||||||
|
* when deleting files.
|
||||||
|
*
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
followSymbolicLinks?: boolean;
|
||||||
|
/**
|
||||||
|
* Indicates whether directories that match a glob pattern, should implicitly
|
||||||
|
* cause all descendant paths to be matched.
|
||||||
|
*
|
||||||
|
* For example, given the directory `my-dir`, the following glob patterns
|
||||||
|
* would produce the same results: `my-dir/**`, `my-dir/`, `my-dir`
|
||||||
|
*
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
implicitDescendants?: boolean;
|
||||||
|
/**
|
||||||
|
* Indicates whether matching directories should be included in the
|
||||||
|
* result set.
|
||||||
|
*
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
matchDirectories?: boolean;
|
||||||
|
/**
|
||||||
|
* Indicates whether broken symbolic should be ignored and omitted from the
|
||||||
|
* result set. Otherwise an error will be thrown.
|
||||||
|
*
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
omitBrokenSymbolicLinks?: boolean;
|
||||||
|
/**
|
||||||
|
* Indicates whether to exclude hidden files (files and directories starting with a `.`).
|
||||||
|
* This does not apply to Windows files and directories with the hidden attribute unless
|
||||||
|
* they are also prefixed with a `.`.
|
||||||
|
*
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
excludeHiddenFiles?: boolean;
|
||||||
|
}
|
||||||
2
node_modules/@actions/glob/lib/internal-glob-options.js
generated
vendored
Normal file
2
node_modules/@actions/glob/lib/internal-glob-options.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export {};
|
||||||
|
//# sourceMappingURL=internal-glob-options.js.map
|
||||||
1
node_modules/@actions/glob/lib/internal-glob-options.js.map
generated
vendored
Normal file
1
node_modules/@actions/glob/lib/internal-glob-options.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"internal-glob-options.js","sourceRoot":"","sources":["../src/internal-glob-options.ts"],"names":[],"mappings":""}
|
||||||
42
node_modules/@actions/glob/lib/internal-globber.d.ts
generated
vendored
Normal file
42
node_modules/@actions/glob/lib/internal-globber.d.ts
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import { GlobOptions } from './internal-glob-options.js';
|
||||||
|
export { GlobOptions };
|
||||||
|
/**
|
||||||
|
* Used to match files and directories
|
||||||
|
*/
|
||||||
|
export interface Globber {
|
||||||
|
/**
|
||||||
|
* Returns the search path preceding the first glob segment, from each pattern.
|
||||||
|
* Duplicates and descendants of other paths are filtered out.
|
||||||
|
*
|
||||||
|
* Example 1: The patterns `/foo/*` and `/bar/*` returns `/foo` and `/bar`.
|
||||||
|
*
|
||||||
|
* Example 2: The patterns `/foo/*` and `/foo/bar/*` returns `/foo`.
|
||||||
|
*/
|
||||||
|
getSearchPaths(): string[];
|
||||||
|
/**
|
||||||
|
* Returns files and directories matching the glob patterns.
|
||||||
|
*
|
||||||
|
* Order of the results is not guaranteed.
|
||||||
|
*/
|
||||||
|
glob(): Promise<string[]>;
|
||||||
|
/**
|
||||||
|
* Returns files and directories matching the glob patterns.
|
||||||
|
*
|
||||||
|
* Order of the results is not guaranteed.
|
||||||
|
*/
|
||||||
|
globGenerator(): AsyncGenerator<string, void>;
|
||||||
|
}
|
||||||
|
export declare class DefaultGlobber implements Globber {
|
||||||
|
private readonly options;
|
||||||
|
private readonly patterns;
|
||||||
|
private readonly searchPaths;
|
||||||
|
private constructor();
|
||||||
|
getSearchPaths(): string[];
|
||||||
|
glob(): Promise<string[]>;
|
||||||
|
globGenerator(): AsyncGenerator<string, void>;
|
||||||
|
/**
|
||||||
|
* Constructs a DefaultGlobber
|
||||||
|
*/
|
||||||
|
static create(patterns: string, options?: GlobOptions): Promise<DefaultGlobber>;
|
||||||
|
private static stat;
|
||||||
|
}
|
||||||
219
node_modules/@actions/glob/lib/internal-globber.js
generated
vendored
Normal file
219
node_modules/@actions/glob/lib/internal-globber.js
generated
vendored
Normal file
@@ -0,0 +1,219 @@
|
|||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
||||||
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||||
|
var m = o[Symbol.asyncIterator], i;
|
||||||
|
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
||||||
|
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
||||||
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
||||||
|
};
|
||||||
|
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||||
|
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||||
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||||
|
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||||
|
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||||
|
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
||||||
|
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
||||||
|
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||||
|
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||||
|
function fulfill(value) { resume("next", value); }
|
||||||
|
function reject(value) { resume("throw", value); }
|
||||||
|
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||||
|
};
|
||||||
|
import * as core from '@actions/core';
|
||||||
|
import * as fs from 'fs';
|
||||||
|
import * as globOptionsHelper from './internal-glob-options-helper.js';
|
||||||
|
import * as path from 'path';
|
||||||
|
import * as patternHelper from './internal-pattern-helper.js';
|
||||||
|
import { MatchKind } from './internal-match-kind.js';
|
||||||
|
import { Pattern } from './internal-pattern.js';
|
||||||
|
import { SearchState } from './internal-search-state.js';
|
||||||
|
const IS_WINDOWS = process.platform === 'win32';
|
||||||
|
export class DefaultGlobber {
|
||||||
|
constructor(options) {
|
||||||
|
this.patterns = [];
|
||||||
|
this.searchPaths = [];
|
||||||
|
this.options = globOptionsHelper.getOptions(options);
|
||||||
|
}
|
||||||
|
getSearchPaths() {
|
||||||
|
// Return a copy
|
||||||
|
return this.searchPaths.slice();
|
||||||
|
}
|
||||||
|
glob() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
var _a, e_1, _b, _c;
|
||||||
|
const result = [];
|
||||||
|
try {
|
||||||
|
for (var _d = true, _e = __asyncValues(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
|
||||||
|
_c = _f.value;
|
||||||
|
_d = false;
|
||||||
|
const itemPath = _c;
|
||||||
|
result.push(itemPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||||
|
finally {
|
||||||
|
try {
|
||||||
|
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
||||||
|
}
|
||||||
|
finally { if (e_1) throw e_1.error; }
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
globGenerator() {
|
||||||
|
return __asyncGenerator(this, arguments, function* globGenerator_1() {
|
||||||
|
// Fill in defaults options
|
||||||
|
const options = globOptionsHelper.getOptions(this.options);
|
||||||
|
// Implicit descendants?
|
||||||
|
const patterns = [];
|
||||||
|
for (const pattern of this.patterns) {
|
||||||
|
patterns.push(pattern);
|
||||||
|
if (options.implicitDescendants &&
|
||||||
|
(pattern.trailingSeparator ||
|
||||||
|
pattern.segments[pattern.segments.length - 1] !== '**')) {
|
||||||
|
patterns.push(new Pattern(pattern.negate, true, pattern.segments.concat('**')));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Push the search paths
|
||||||
|
const stack = [];
|
||||||
|
for (const searchPath of patternHelper.getSearchPaths(patterns)) {
|
||||||
|
core.debug(`Search path '${searchPath}'`);
|
||||||
|
// Exists?
|
||||||
|
try {
|
||||||
|
// Intentionally using lstat. Detection for broken symlink
|
||||||
|
// will be performed later (if following symlinks).
|
||||||
|
yield __await(fs.promises.lstat(searchPath));
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
if (err.code === 'ENOENT') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
stack.unshift(new SearchState(searchPath, 1));
|
||||||
|
}
|
||||||
|
// Search
|
||||||
|
const traversalChain = []; // used to detect cycles
|
||||||
|
while (stack.length) {
|
||||||
|
// Pop
|
||||||
|
const item = stack.pop();
|
||||||
|
// Match?
|
||||||
|
const match = patternHelper.match(patterns, item.path);
|
||||||
|
const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path);
|
||||||
|
if (!match && !partialMatch) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// Stat
|
||||||
|
const stats = yield __await(DefaultGlobber.stat(item, options, traversalChain)
|
||||||
|
// Broken symlink, or symlink cycle detected, or no longer exists
|
||||||
|
);
|
||||||
|
// Broken symlink, or symlink cycle detected, or no longer exists
|
||||||
|
if (!stats) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// Hidden file or directory?
|
||||||
|
if (options.excludeHiddenFiles && path.basename(item.path).match(/^\./)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// Directory
|
||||||
|
if (stats.isDirectory()) {
|
||||||
|
// Matched
|
||||||
|
if (match & MatchKind.Directory && options.matchDirectories) {
|
||||||
|
yield yield __await(item.path);
|
||||||
|
}
|
||||||
|
// Descend?
|
||||||
|
else if (!partialMatch) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// Push the child items in reverse
|
||||||
|
const childLevel = item.level + 1;
|
||||||
|
const childItems = (yield __await(fs.promises.readdir(item.path))).map(x => new SearchState(path.join(item.path, x), childLevel));
|
||||||
|
stack.push(...childItems.reverse());
|
||||||
|
}
|
||||||
|
// File
|
||||||
|
else if (match & MatchKind.File) {
|
||||||
|
yield yield __await(item.path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Constructs a DefaultGlobber
|
||||||
|
*/
|
||||||
|
static create(patterns, options) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = new DefaultGlobber(options);
|
||||||
|
if (IS_WINDOWS) {
|
||||||
|
patterns = patterns.replace(/\r\n/g, '\n');
|
||||||
|
patterns = patterns.replace(/\r/g, '\n');
|
||||||
|
}
|
||||||
|
const lines = patterns.split('\n').map(x => x.trim());
|
||||||
|
for (const line of lines) {
|
||||||
|
// Empty or comment
|
||||||
|
if (!line || line.startsWith('#')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// Pattern
|
||||||
|
else {
|
||||||
|
result.patterns.push(new Pattern(line));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns));
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
static stat(item, options, traversalChain) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
// Note:
|
||||||
|
// `stat` returns info about the target of a symlink (or symlink chain)
|
||||||
|
// `lstat` returns info about a symlink itself
|
||||||
|
let stats;
|
||||||
|
if (options.followSymbolicLinks) {
|
||||||
|
try {
|
||||||
|
// Use `stat` (following symlinks)
|
||||||
|
stats = yield fs.promises.stat(item.path);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
if (err.code === 'ENOENT') {
|
||||||
|
if (options.omitBrokenSymbolicLinks) {
|
||||||
|
core.debug(`Broken symlink '${item.path}'`);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`);
|
||||||
|
}
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Use `lstat` (not following symlinks)
|
||||||
|
stats = yield fs.promises.lstat(item.path);
|
||||||
|
}
|
||||||
|
// Note, isDirectory() returns false for the lstat of a symlink
|
||||||
|
if (stats.isDirectory() && options.followSymbolicLinks) {
|
||||||
|
// Get the realpath
|
||||||
|
const realPath = yield fs.promises.realpath(item.path);
|
||||||
|
// Fixup the traversal chain to match the item level
|
||||||
|
while (traversalChain.length >= item.level) {
|
||||||
|
traversalChain.pop();
|
||||||
|
}
|
||||||
|
// Test for a cycle
|
||||||
|
if (traversalChain.some((x) => x === realPath)) {
|
||||||
|
core.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
// Update the traversal chain
|
||||||
|
traversalChain.push(realPath);
|
||||||
|
}
|
||||||
|
return stats;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=internal-globber.js.map
|
||||||
1
node_modules/@actions/glob/lib/internal-globber.js.map
generated
vendored
Normal file
1
node_modules/@actions/glob/lib/internal-globber.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
12
node_modules/@actions/glob/lib/internal-hash-file-options.d.ts
generated
vendored
Normal file
12
node_modules/@actions/glob/lib/internal-hash-file-options.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* Options to control globbing behavior
|
||||||
|
*/
|
||||||
|
export interface HashFileOptions {
|
||||||
|
/**
|
||||||
|
* Indicates whether to follow symbolic links. Generally should set to false
|
||||||
|
* when deleting files.
|
||||||
|
*
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
followSymbolicLinks?: boolean;
|
||||||
|
}
|
||||||
2
node_modules/@actions/glob/lib/internal-hash-file-options.js
generated
vendored
Normal file
2
node_modules/@actions/glob/lib/internal-hash-file-options.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export {};
|
||||||
|
//# sourceMappingURL=internal-hash-file-options.js.map
|
||||||
1
node_modules/@actions/glob/lib/internal-hash-file-options.js.map
generated
vendored
Normal file
1
node_modules/@actions/glob/lib/internal-hash-file-options.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"internal-hash-file-options.js","sourceRoot":"","sources":["../src/internal-hash-file-options.ts"],"names":[],"mappings":""}
|
||||||
2
node_modules/@actions/glob/lib/internal-hash-files.d.ts
generated
vendored
Normal file
2
node_modules/@actions/glob/lib/internal-hash-files.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
import { Globber } from './glob.js';
|
||||||
|
export declare function hashFiles(globber: Globber, currentWorkspace: string, verbose?: Boolean): Promise<string>;
|
||||||
76
node_modules/@actions/glob/lib/internal-hash-files.js
generated
vendored
Normal file
76
node_modules/@actions/glob/lib/internal-hash-files.js
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
||||||
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||||
|
var m = o[Symbol.asyncIterator], i;
|
||||||
|
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
||||||
|
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
||||||
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
||||||
|
};
|
||||||
|
import * as crypto from 'crypto';
|
||||||
|
import * as core from '@actions/core';
|
||||||
|
import * as fs from 'fs';
|
||||||
|
import * as stream from 'stream';
|
||||||
|
import * as util from 'util';
|
||||||
|
import * as path from 'path';
|
||||||
|
export function hashFiles(globber_1, currentWorkspace_1) {
|
||||||
|
return __awaiter(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) {
|
||||||
|
var _a, e_1, _b, _c;
|
||||||
|
var _d;
|
||||||
|
const writeDelegate = verbose ? core.info : core.debug;
|
||||||
|
let hasMatch = false;
|
||||||
|
const githubWorkspace = currentWorkspace
|
||||||
|
? currentWorkspace
|
||||||
|
: ((_d = process.env['GITHUB_WORKSPACE']) !== null && _d !== void 0 ? _d : process.cwd());
|
||||||
|
const result = crypto.createHash('sha256');
|
||||||
|
let count = 0;
|
||||||
|
try {
|
||||||
|
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {
|
||||||
|
_c = _g.value;
|
||||||
|
_e = false;
|
||||||
|
const file = _c;
|
||||||
|
writeDelegate(file);
|
||||||
|
if (!file.startsWith(`${githubWorkspace}${path.sep}`)) {
|
||||||
|
writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (fs.statSync(file).isDirectory()) {
|
||||||
|
writeDelegate(`Skip directory '${file}'.`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const hash = crypto.createHash('sha256');
|
||||||
|
const pipeline = util.promisify(stream.pipeline);
|
||||||
|
yield pipeline(fs.createReadStream(file), hash);
|
||||||
|
result.write(hash.digest());
|
||||||
|
count++;
|
||||||
|
if (!hasMatch) {
|
||||||
|
hasMatch = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||||
|
finally {
|
||||||
|
try {
|
||||||
|
if (!_e && !_a && (_b = _f.return)) yield _b.call(_f);
|
||||||
|
}
|
||||||
|
finally { if (e_1) throw e_1.error; }
|
||||||
|
}
|
||||||
|
result.end();
|
||||||
|
if (hasMatch) {
|
||||||
|
writeDelegate(`Found ${count} files to hash.`);
|
||||||
|
return result.digest('hex');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
writeDelegate(`No matches found for glob`);
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=internal-hash-files.js.map
|
||||||
1
node_modules/@actions/glob/lib/internal-hash-files.js.map
generated
vendored
Normal file
1
node_modules/@actions/glob/lib/internal-hash-files.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"internal-hash-files.js","sourceRoot":"","sources":["../src/internal-hash-files.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA;AACrC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAG5B,MAAM,UAAgB,SAAS;yDAC7B,OAAgB,EAChB,gBAAwB,EACxB,UAAmB,KAAK;;;QAExB,MAAM,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAA;QACtD,IAAI,QAAQ,GAAG,KAAK,CAAA;QACpB,MAAM,eAAe,GAAG,gBAAgB;YACtC,CAAC,CAAC,gBAAgB;YAClB,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,mCAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QACtD,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;QAC1C,IAAI,KAAK,GAAG,CAAC,CAAA;;YACb,KAAyB,eAAA,KAAA,cAAA,OAAO,CAAC,aAAa,EAAE,CAAA,IAAA,sDAAE,CAAC;gBAA1B,cAAuB;gBAAvB,WAAuB;gBAArC,MAAM,IAAI,KAAA,CAAA;gBACnB,aAAa,CAAC,IAAI,CAAC,CAAA;gBACnB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,eAAe,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC;oBACtD,aAAa,CAAC,WAAW,IAAI,2CAA2C,CAAC,CAAA;oBACzE,SAAQ;gBACV,CAAC;gBACD,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;oBACpC,aAAa,CAAC,mBAAmB,IAAI,IAAI,CAAC,CAAA;oBAC1C,SAAQ;gBACV,CAAC;gBACD,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;gBACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;gBAChD,MAAM,QAAQ,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;gBAC/C,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;gBAC3B,KAAK,EAAE,CAAA;gBACP,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACd,QAAQ,GAAG,IAAI,CAAA;gBACjB,CAAC;YACH,CAAC;;;;;;;;;QACD,MAAM,CAAC,GAAG,EAAE,CAAA;QAEZ,IAAI,QAAQ,EAAE,CAAC;YACb,aAAa,CAAC,SAAS,KAAK,iBAAiB,CAAC,CAAA;YAC9C,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAC7B,CAAC;aAAM,CAAC;YACN,aAAa,CAAC,2BAA2B,CAAC,CAAA;YAC1C,OAAO,EAAE,CAAA;QACX,CAAC;IACH,CAAC;CAAA"}
|
||||||
13
node_modules/@actions/glob/lib/internal-match-kind.d.ts
generated
vendored
Normal file
13
node_modules/@actions/glob/lib/internal-match-kind.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/**
|
||||||
|
* Indicates whether a pattern matches a path
|
||||||
|
*/
|
||||||
|
export declare enum MatchKind {
|
||||||
|
/** Not matched */
|
||||||
|
None = 0,
|
||||||
|
/** Matched if the path is a directory */
|
||||||
|
Directory = 1,
|
||||||
|
/** Matched if the path is a regular file */
|
||||||
|
File = 2,
|
||||||
|
/** Matched */
|
||||||
|
All = 3
|
||||||
|
}
|
||||||
15
node_modules/@actions/glob/lib/internal-match-kind.js
generated
vendored
Normal file
15
node_modules/@actions/glob/lib/internal-match-kind.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Indicates whether a pattern matches a path
|
||||||
|
*/
|
||||||
|
export var MatchKind;
|
||||||
|
(function (MatchKind) {
|
||||||
|
/** Not matched */
|
||||||
|
MatchKind[MatchKind["None"] = 0] = "None";
|
||||||
|
/** Matched if the path is a directory */
|
||||||
|
MatchKind[MatchKind["Directory"] = 1] = "Directory";
|
||||||
|
/** Matched if the path is a regular file */
|
||||||
|
MatchKind[MatchKind["File"] = 2] = "File";
|
||||||
|
/** Matched */
|
||||||
|
MatchKind[MatchKind["All"] = 3] = "All";
|
||||||
|
})(MatchKind || (MatchKind = {}));
|
||||||
|
//# sourceMappingURL=internal-match-kind.js.map
|
||||||
1
node_modules/@actions/glob/lib/internal-match-kind.js.map
generated
vendored
Normal file
1
node_modules/@actions/glob/lib/internal-match-kind.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"internal-match-kind.js","sourceRoot":"","sources":["../src/internal-match-kind.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,kBAAkB;IAClB,yCAAQ,CAAA;IAER,yCAAyC;IACzC,mDAAa,CAAA;IAEb,4CAA4C;IAC5C,yCAAQ,CAAA;IAER,cAAc;IACd,uCAAsB,CAAA;AACxB,CAAC,EAZW,SAAS,KAAT,SAAS,QAYpB"}
|
||||||
42
node_modules/@actions/glob/lib/internal-path-helper.d.ts
generated
vendored
Normal file
42
node_modules/@actions/glob/lib/internal-path-helper.d.ts
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/**
|
||||||
|
* Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths.
|
||||||
|
*
|
||||||
|
* For example, on Linux/macOS:
|
||||||
|
* - `/ => /`
|
||||||
|
* - `/hello => /`
|
||||||
|
*
|
||||||
|
* For example, on Windows:
|
||||||
|
* - `C:\ => C:\`
|
||||||
|
* - `C:\hello => C:\`
|
||||||
|
* - `C: => C:`
|
||||||
|
* - `C:hello => C:`
|
||||||
|
* - `\ => \`
|
||||||
|
* - `\hello => \`
|
||||||
|
* - `\\hello => \\hello`
|
||||||
|
* - `\\hello\world => \\hello\world`
|
||||||
|
*/
|
||||||
|
export declare function dirname(p: string): string;
|
||||||
|
/**
|
||||||
|
* Roots the path if not already rooted. On Windows, relative roots like `\`
|
||||||
|
* or `C:` are expanded based on the current working directory.
|
||||||
|
*/
|
||||||
|
export declare function ensureAbsoluteRoot(root: string, itemPath: string): string;
|
||||||
|
/**
|
||||||
|
* On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:
|
||||||
|
* `\\hello\share` and `C:\hello` (and using alternate separator).
|
||||||
|
*/
|
||||||
|
export declare function hasAbsoluteRoot(itemPath: string): boolean;
|
||||||
|
/**
|
||||||
|
* On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:
|
||||||
|
* `\`, `\hello`, `\\hello\share`, `C:`, and `C:\hello` (and using alternate separator).
|
||||||
|
*/
|
||||||
|
export declare function hasRoot(itemPath: string): boolean;
|
||||||
|
/**
|
||||||
|
* Removes redundant slashes and converts `/` to `\` on Windows
|
||||||
|
*/
|
||||||
|
export declare function normalizeSeparators(p: string): string;
|
||||||
|
/**
|
||||||
|
* Normalizes the path separators and trims the trailing separator (when safe).
|
||||||
|
* For example, `/foo/ => /foo` but `/ => /`
|
||||||
|
*/
|
||||||
|
export declare function safeTrimTrailingSeparator(p: string): string;
|
||||||
167
node_modules/@actions/glob/lib/internal-path-helper.js
generated
vendored
Normal file
167
node_modules/@actions/glob/lib/internal-path-helper.js
generated
vendored
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
import * as path from 'path';
|
||||||
|
import assert from 'assert';
|
||||||
|
const IS_WINDOWS = process.platform === 'win32';
|
||||||
|
/**
|
||||||
|
* Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths.
|
||||||
|
*
|
||||||
|
* For example, on Linux/macOS:
|
||||||
|
* - `/ => /`
|
||||||
|
* - `/hello => /`
|
||||||
|
*
|
||||||
|
* For example, on Windows:
|
||||||
|
* - `C:\ => C:\`
|
||||||
|
* - `C:\hello => C:\`
|
||||||
|
* - `C: => C:`
|
||||||
|
* - `C:hello => C:`
|
||||||
|
* - `\ => \`
|
||||||
|
* - `\hello => \`
|
||||||
|
* - `\\hello => \\hello`
|
||||||
|
* - `\\hello\world => \\hello\world`
|
||||||
|
*/
|
||||||
|
export function dirname(p) {
|
||||||
|
// Normalize slashes and trim unnecessary trailing slash
|
||||||
|
p = safeTrimTrailingSeparator(p);
|
||||||
|
// Windows UNC root, e.g. \\hello or \\hello\world
|
||||||
|
if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) {
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
// Get dirname
|
||||||
|
let result = path.dirname(p);
|
||||||
|
// Trim trailing slash for Windows UNC root, e.g. \\hello\world\
|
||||||
|
if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) {
|
||||||
|
result = safeTrimTrailingSeparator(result);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Roots the path if not already rooted. On Windows, relative roots like `\`
|
||||||
|
* or `C:` are expanded based on the current working directory.
|
||||||
|
*/
|
||||||
|
export function ensureAbsoluteRoot(root, itemPath) {
|
||||||
|
assert(root, `ensureAbsoluteRoot parameter 'root' must not be empty`);
|
||||||
|
assert(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`);
|
||||||
|
// Already rooted
|
||||||
|
if (hasAbsoluteRoot(itemPath)) {
|
||||||
|
return itemPath;
|
||||||
|
}
|
||||||
|
// Windows
|
||||||
|
if (IS_WINDOWS) {
|
||||||
|
// Check for itemPath like C: or C:foo
|
||||||
|
if (itemPath.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)) {
|
||||||
|
let cwd = process.cwd();
|
||||||
|
assert(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);
|
||||||
|
// Drive letter matches cwd? Expand to cwd
|
||||||
|
if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) {
|
||||||
|
// Drive only, e.g. C:
|
||||||
|
if (itemPath.length === 2) {
|
||||||
|
// Preserve specified drive letter case (upper or lower)
|
||||||
|
return `${itemPath[0]}:\\${cwd.substr(3)}`;
|
||||||
|
}
|
||||||
|
// Drive + path, e.g. C:foo
|
||||||
|
else {
|
||||||
|
if (!cwd.endsWith('\\')) {
|
||||||
|
cwd += '\\';
|
||||||
|
}
|
||||||
|
// Preserve specified drive letter case (upper or lower)
|
||||||
|
return `${itemPath[0]}:\\${cwd.substr(3)}${itemPath.substr(2)}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Different drive
|
||||||
|
else {
|
||||||
|
return `${itemPath[0]}:\\${itemPath.substr(2)}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Check for itemPath like \ or \foo
|
||||||
|
else if (normalizeSeparators(itemPath).match(/^\\$|^\\[^\\]/)) {
|
||||||
|
const cwd = process.cwd();
|
||||||
|
assert(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);
|
||||||
|
return `${cwd[0]}:\\${itemPath.substr(1)}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assert(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`);
|
||||||
|
// Otherwise ensure root ends with a separator
|
||||||
|
if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\'))) {
|
||||||
|
// Intentionally empty
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Append separator
|
||||||
|
root += path.sep;
|
||||||
|
}
|
||||||
|
return root + itemPath;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:
|
||||||
|
* `\\hello\share` and `C:\hello` (and using alternate separator).
|
||||||
|
*/
|
||||||
|
export function hasAbsoluteRoot(itemPath) {
|
||||||
|
assert(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`);
|
||||||
|
// Normalize separators
|
||||||
|
itemPath = normalizeSeparators(itemPath);
|
||||||
|
// Windows
|
||||||
|
if (IS_WINDOWS) {
|
||||||
|
// E.g. \\hello\share or C:\hello
|
||||||
|
return itemPath.startsWith('\\\\') || /^[A-Z]:\\/i.test(itemPath);
|
||||||
|
}
|
||||||
|
// E.g. /hello
|
||||||
|
return itemPath.startsWith('/');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:
|
||||||
|
* `\`, `\hello`, `\\hello\share`, `C:`, and `C:\hello` (and using alternate separator).
|
||||||
|
*/
|
||||||
|
export function hasRoot(itemPath) {
|
||||||
|
assert(itemPath, `isRooted parameter 'itemPath' must not be empty`);
|
||||||
|
// Normalize separators
|
||||||
|
itemPath = normalizeSeparators(itemPath);
|
||||||
|
// Windows
|
||||||
|
if (IS_WINDOWS) {
|
||||||
|
// E.g. \ or \hello or \\hello
|
||||||
|
// E.g. C: or C:\hello
|
||||||
|
return itemPath.startsWith('\\') || /^[A-Z]:/i.test(itemPath);
|
||||||
|
}
|
||||||
|
// E.g. /hello
|
||||||
|
return itemPath.startsWith('/');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Removes redundant slashes and converts `/` to `\` on Windows
|
||||||
|
*/
|
||||||
|
export function normalizeSeparators(p) {
|
||||||
|
p = p || '';
|
||||||
|
// Windows
|
||||||
|
if (IS_WINDOWS) {
|
||||||
|
// Convert slashes on Windows
|
||||||
|
p = p.replace(/\//g, '\\');
|
||||||
|
// Remove redundant slashes
|
||||||
|
const isUnc = /^\\\\+[^\\]/.test(p); // e.g. \\hello
|
||||||
|
return (isUnc ? '\\' : '') + p.replace(/\\\\+/g, '\\'); // preserve leading \\ for UNC
|
||||||
|
}
|
||||||
|
// Remove redundant slashes
|
||||||
|
return p.replace(/\/\/+/g, '/');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Normalizes the path separators and trims the trailing separator (when safe).
|
||||||
|
* For example, `/foo/ => /foo` but `/ => /`
|
||||||
|
*/
|
||||||
|
export function safeTrimTrailingSeparator(p) {
|
||||||
|
// Short-circuit if empty
|
||||||
|
if (!p) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
// Normalize separators
|
||||||
|
p = normalizeSeparators(p);
|
||||||
|
// No trailing slash
|
||||||
|
if (!p.endsWith(path.sep)) {
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
// Check '/' on Linux/macOS and '\' on Windows
|
||||||
|
if (p === path.sep) {
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
// On Windows check if drive root. E.g. C:\
|
||||||
|
if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) {
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
// Otherwise trim trailing slash
|
||||||
|
return p.substr(0, p.length - 1);
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=internal-path-helper.js.map
|
||||||
1
node_modules/@actions/glob/lib/internal-path-helper.js.map
generated
vendored
Normal file
1
node_modules/@actions/glob/lib/internal-path-helper.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"internal-path-helper.js","sourceRoot":"","sources":["../src/internal-path-helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAA;AAE/C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,OAAO,CAAC,CAAS;IAC/B,wDAAwD;IACxD,CAAC,GAAG,yBAAyB,CAAC,CAAC,CAAC,CAAA;IAEhC,kDAAkD;IAClD,IAAI,UAAU,IAAI,yBAAyB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACpD,OAAO,CAAC,CAAA;IACV,CAAC;IAED,cAAc;IACd,IAAI,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAE5B,gEAAgE;IAChE,IAAI,UAAU,IAAI,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACxD,MAAM,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAA;IAC5C,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,QAAgB;IAC/D,MAAM,CAAC,IAAI,EAAE,uDAAuD,CAAC,CAAA;IACrE,MAAM,CAAC,QAAQ,EAAE,2DAA2D,CAAC,CAAA;IAE7E,iBAAiB;IACjB,IAAI,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9B,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,UAAU;IACV,IAAI,UAAU,EAAE,CAAC;QACf,sCAAsC;QACtC,IAAI,QAAQ,CAAC,KAAK,CAAC,yBAAyB,CAAC,EAAE,CAAC;YAC9C,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;YACvB,MAAM,CACJ,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,EACvB,4EAA4E,GAAG,GAAG,CACnF,CAAA;YAED,0CAA0C;YAC1C,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;gBACvD,sBAAsB;gBACtB,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBAC1B,wDAAwD;oBACxD,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;gBAC5C,CAAC;gBACD,2BAA2B;qBACtB,CAAC;oBACJ,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;wBACxB,GAAG,IAAI,IAAI,CAAA;oBACb,CAAC;oBACD,wDAAwD;oBACxD,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;gBACjE,CAAC;YACH,CAAC;YACD,kBAAkB;iBACb,CAAC;gBACJ,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;YACjD,CAAC;QACH,CAAC;QACD,oCAAoC;aAC/B,IAAI,mBAAmB,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC;YAC9D,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;YACzB,MAAM,CACJ,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,EACvB,4EAA4E,GAAG,GAAG,CACnF,CAAA;YAED,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;QAC5C,CAAC;IACH,CAAC;IAED,MAAM,CACJ,eAAe,CAAC,IAAI,CAAC,EACrB,gEAAgE,CACjE,CAAA;IAED,8CAA8C;IAC9C,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QAC9D,sBAAsB;IACxB,CAAC;SAAM,CAAC;QACN,mBAAmB;QACnB,IAAI,IAAI,IAAI,CAAC,GAAG,CAAA;IAClB,CAAC;IAED,OAAO,IAAI,GAAG,QAAQ,CAAA;AACxB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,MAAM,CAAC,QAAQ,EAAE,wDAAwD,CAAC,CAAA;IAE1E,uBAAuB;IACvB,QAAQ,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAA;IAExC,UAAU;IACV,IAAI,UAAU,EAAE,CAAC;QACf,iCAAiC;QACjC,OAAO,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACnE,CAAC;IAED,cAAc;IACd,OAAO,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AACjC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,QAAgB;IACtC,MAAM,CAAC,QAAQ,EAAE,iDAAiD,CAAC,CAAA;IAEnE,uBAAuB;IACvB,QAAQ,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAA;IAExC,UAAU;IACV,IAAI,UAAU,EAAE,CAAC;QACf,8BAA8B;QAC9B,sBAAsB;QACtB,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC/D,CAAC;IAED,cAAc;IACd,OAAO,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,CAAS;IAC3C,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;IAEX,UAAU;IACV,IAAI,UAAU,EAAE,CAAC;QACf,6BAA6B;QAC7B,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAE1B,2BAA2B;QAC3B,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA,CAAC,eAAe;QACnD,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA,CAAC,8BAA8B;IACvF,CAAC;IAED,2BAA2B;IAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,CAAS;IACjD,yBAAyB;IACzB,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;IAED,uBAAuB;IACvB,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAA;IAE1B,oBAAoB;IACpB,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1B,OAAO,CAAC,CAAA;IACV,CAAC;IAED,8CAA8C;IAC9C,IAAI,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC;QACnB,OAAO,CAAC,CAAA;IACV,CAAC;IAED,2CAA2C;IAC3C,IAAI,UAAU,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACxC,OAAO,CAAC,CAAA;IACV,CAAC;IAED,gCAAgC;IAChC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;AAClC,CAAC"}
|
||||||
15
node_modules/@actions/glob/lib/internal-path.d.ts
generated
vendored
Normal file
15
node_modules/@actions/glob/lib/internal-path.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Helper class for parsing paths into segments
|
||||||
|
*/
|
||||||
|
export declare class Path {
|
||||||
|
segments: string[];
|
||||||
|
/**
|
||||||
|
* Constructs a Path
|
||||||
|
* @param itemPath Path or array of segments
|
||||||
|
*/
|
||||||
|
constructor(itemPath: string | string[]);
|
||||||
|
/**
|
||||||
|
* Converts the path to it's string representation
|
||||||
|
*/
|
||||||
|
toString(): string;
|
||||||
|
}
|
||||||
87
node_modules/@actions/glob/lib/internal-path.js
generated
vendored
Normal file
87
node_modules/@actions/glob/lib/internal-path.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
import * as path from 'path';
|
||||||
|
import * as pathHelper from './internal-path-helper.js';
|
||||||
|
import assert from 'assert';
|
||||||
|
const IS_WINDOWS = process.platform === 'win32';
|
||||||
|
/**
|
||||||
|
* Helper class for parsing paths into segments
|
||||||
|
*/
|
||||||
|
export class Path {
|
||||||
|
/**
|
||||||
|
* Constructs a Path
|
||||||
|
* @param itemPath Path or array of segments
|
||||||
|
*/
|
||||||
|
constructor(itemPath) {
|
||||||
|
this.segments = [];
|
||||||
|
// String
|
||||||
|
if (typeof itemPath === 'string') {
|
||||||
|
assert(itemPath, `Parameter 'itemPath' must not be empty`);
|
||||||
|
// Normalize slashes and trim unnecessary trailing slash
|
||||||
|
itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);
|
||||||
|
// Not rooted
|
||||||
|
if (!pathHelper.hasRoot(itemPath)) {
|
||||||
|
this.segments = itemPath.split(path.sep);
|
||||||
|
}
|
||||||
|
// Rooted
|
||||||
|
else {
|
||||||
|
// Add all segments, while not at the root
|
||||||
|
let remaining = itemPath;
|
||||||
|
let dir = pathHelper.dirname(remaining);
|
||||||
|
while (dir !== remaining) {
|
||||||
|
// Add the segment
|
||||||
|
const basename = path.basename(remaining);
|
||||||
|
this.segments.unshift(basename);
|
||||||
|
// Truncate the last segment
|
||||||
|
remaining = dir;
|
||||||
|
dir = pathHelper.dirname(remaining);
|
||||||
|
}
|
||||||
|
// Remainder is the root
|
||||||
|
this.segments.unshift(remaining);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Array
|
||||||
|
else {
|
||||||
|
// Must not be empty
|
||||||
|
assert(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`);
|
||||||
|
// Each segment
|
||||||
|
for (let i = 0; i < itemPath.length; i++) {
|
||||||
|
let segment = itemPath[i];
|
||||||
|
// Must not be empty
|
||||||
|
assert(segment, `Parameter 'itemPath' must not contain any empty segments`);
|
||||||
|
// Normalize slashes
|
||||||
|
segment = pathHelper.normalizeSeparators(itemPath[i]);
|
||||||
|
// Root segment
|
||||||
|
if (i === 0 && pathHelper.hasRoot(segment)) {
|
||||||
|
segment = pathHelper.safeTrimTrailingSeparator(segment);
|
||||||
|
assert(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`);
|
||||||
|
this.segments.push(segment);
|
||||||
|
}
|
||||||
|
// All other segments
|
||||||
|
else {
|
||||||
|
// Must not contain slash
|
||||||
|
assert(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`);
|
||||||
|
this.segments.push(segment);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Converts the path to it's string representation
|
||||||
|
*/
|
||||||
|
toString() {
|
||||||
|
// First segment
|
||||||
|
let result = this.segments[0];
|
||||||
|
// All others
|
||||||
|
let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result));
|
||||||
|
for (let i = 1; i < this.segments.length; i++) {
|
||||||
|
if (skipSlash) {
|
||||||
|
skipSlash = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result += path.sep;
|
||||||
|
}
|
||||||
|
result += this.segments[i];
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=internal-path.js.map
|
||||||
1
node_modules/@actions/glob/lib/internal-path.js.map
generated
vendored
Normal file
1
node_modules/@actions/glob/lib/internal-path.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"internal-path.js","sourceRoot":"","sources":["../src/internal-path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAA;AACvD,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAA;AAE/C;;GAEG;AACH,MAAM,OAAO,IAAI;IAGf;;;OAGG;IACH,YAAY,QAA2B;QANvC,aAAQ,GAAa,EAAE,CAAA;QAOrB,SAAS;QACT,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACjC,MAAM,CAAC,QAAQ,EAAE,wCAAwC,CAAC,CAAA;YAE1D,wDAAwD;YACxD,QAAQ,GAAG,UAAU,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAA;YAEzD,aAAa;YACb,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAClC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YAC1C,CAAC;YACD,SAAS;iBACJ,CAAC;gBACJ,0CAA0C;gBAC1C,IAAI,SAAS,GAAG,QAAQ,CAAA;gBACxB,IAAI,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;gBACvC,OAAO,GAAG,KAAK,SAAS,EAAE,CAAC;oBACzB,kBAAkB;oBAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;oBACzC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;oBAE/B,4BAA4B;oBAC5B,SAAS,GAAG,GAAG,CAAA;oBACf,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;gBACrC,CAAC;gBAED,wBAAwB;gBACxB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;YAClC,CAAC;QACH,CAAC;QACD,QAAQ;aACH,CAAC;YACJ,oBAAoB;YACpB,MAAM,CACJ,QAAQ,CAAC,MAAM,GAAG,CAAC,EACnB,iDAAiD,CAClD,CAAA;YAED,eAAe;YACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACzC,IAAI,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;gBAEzB,oBAAoB;gBACpB,MAAM,CACJ,OAAO,EACP,0DAA0D,CAC3D,CAAA;gBAED,oBAAoB;gBACpB,OAAO,GAAG,UAAU,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;gBAErD,eAAe;gBACf,IAAI,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC3C,OAAO,GAAG,UAAU,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAA;oBACvD,MAAM,CACJ,OAAO,KAAK,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,EACvC,8EAA8E,CAC/E,CAAA;oBACD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;gBAC7B,CAAC;gBACD,qBAAqB;qBAChB,CAAC;oBACJ,yBAAyB;oBACzB,MAAM,CACJ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAC3B,0DAA0D,CAC3D,CAAA;oBACD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;gBAC7B,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,gBAAgB;QAChB,IAAI,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;QAE7B,aAAa;QACb,IAAI,SAAS,GACX,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,IAAI,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;QACvE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9C,IAAI,SAAS,EAAE,CAAC;gBACd,SAAS,GAAG,KAAK,CAAA;YACnB,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,IAAI,CAAC,GAAG,CAAA;YACpB,CAAC;YAED,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;QAC5B,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CACF"}
|
||||||
15
node_modules/@actions/glob/lib/internal-pattern-helper.d.ts
generated
vendored
Normal file
15
node_modules/@actions/glob/lib/internal-pattern-helper.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import { MatchKind } from './internal-match-kind.js';
|
||||||
|
import { Pattern } from './internal-pattern.js';
|
||||||
|
/**
|
||||||
|
* Given an array of patterns, returns an array of paths to search.
|
||||||
|
* Duplicates and paths under other included paths are filtered out.
|
||||||
|
*/
|
||||||
|
export declare function getSearchPaths(patterns: Pattern[]): string[];
|
||||||
|
/**
|
||||||
|
* Matches the patterns against the path
|
||||||
|
*/
|
||||||
|
export declare function match(patterns: Pattern[], itemPath: string): MatchKind;
|
||||||
|
/**
|
||||||
|
* Checks whether to descend further into the directory
|
||||||
|
*/
|
||||||
|
export declare function partialMatch(patterns: Pattern[], itemPath: string): boolean;
|
||||||
69
node_modules/@actions/glob/lib/internal-pattern-helper.js
generated
vendored
Normal file
69
node_modules/@actions/glob/lib/internal-pattern-helper.js
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
import * as pathHelper from './internal-path-helper.js';
|
||||||
|
import { MatchKind } from './internal-match-kind.js';
|
||||||
|
const IS_WINDOWS = process.platform === 'win32';
|
||||||
|
/**
|
||||||
|
* Given an array of patterns, returns an array of paths to search.
|
||||||
|
* Duplicates and paths under other included paths are filtered out.
|
||||||
|
*/
|
||||||
|
export function getSearchPaths(patterns) {
|
||||||
|
// Ignore negate patterns
|
||||||
|
patterns = patterns.filter(x => !x.negate);
|
||||||
|
// Create a map of all search paths
|
||||||
|
const searchPathMap = {};
|
||||||
|
for (const pattern of patterns) {
|
||||||
|
const key = IS_WINDOWS
|
||||||
|
? pattern.searchPath.toUpperCase()
|
||||||
|
: pattern.searchPath;
|
||||||
|
searchPathMap[key] = 'candidate';
|
||||||
|
}
|
||||||
|
const result = [];
|
||||||
|
for (const pattern of patterns) {
|
||||||
|
// Check if already included
|
||||||
|
const key = IS_WINDOWS
|
||||||
|
? pattern.searchPath.toUpperCase()
|
||||||
|
: pattern.searchPath;
|
||||||
|
if (searchPathMap[key] === 'included') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// Check for an ancestor search path
|
||||||
|
let foundAncestor = false;
|
||||||
|
let tempKey = key;
|
||||||
|
let parent = pathHelper.dirname(tempKey);
|
||||||
|
while (parent !== tempKey) {
|
||||||
|
if (searchPathMap[parent]) {
|
||||||
|
foundAncestor = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
tempKey = parent;
|
||||||
|
parent = pathHelper.dirname(tempKey);
|
||||||
|
}
|
||||||
|
// Include the search pattern in the result
|
||||||
|
if (!foundAncestor) {
|
||||||
|
result.push(pattern.searchPath);
|
||||||
|
searchPathMap[key] = 'included';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Matches the patterns against the path
|
||||||
|
*/
|
||||||
|
export function match(patterns, itemPath) {
|
||||||
|
let result = MatchKind.None;
|
||||||
|
for (const pattern of patterns) {
|
||||||
|
if (pattern.negate) {
|
||||||
|
result &= ~pattern.match(itemPath);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result |= pattern.match(itemPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Checks whether to descend further into the directory
|
||||||
|
*/
|
||||||
|
export function partialMatch(patterns, itemPath) {
|
||||||
|
return patterns.some(x => !x.negate && x.partialMatch(itemPath));
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=internal-pattern-helper.js.map
|
||||||
1
node_modules/@actions/glob/lib/internal-pattern-helper.js.map
generated
vendored
Normal file
1
node_modules/@actions/glob/lib/internal-pattern-helper.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"internal-pattern-helper.js","sourceRoot":"","sources":["../src/internal-pattern-helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAA;AAGlD,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAA;AAE/C;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,QAAmB;IAChD,yBAAyB;IACzB,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IAE1C,mCAAmC;IACnC,MAAM,aAAa,GAA4B,EAAE,CAAA;IACjD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,GAAG,GAAG,UAAU;YACpB,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE;YAClC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAA;QACtB,aAAa,CAAC,GAAG,CAAC,GAAG,WAAW,CAAA;IAClC,CAAC;IAED,MAAM,MAAM,GAAa,EAAE,CAAA;IAE3B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,4BAA4B;QAC5B,MAAM,GAAG,GAAG,UAAU;YACpB,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE;YAClC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAA;QACtB,IAAI,aAAa,CAAC,GAAG,CAAC,KAAK,UAAU,EAAE,CAAC;YACtC,SAAQ;QACV,CAAC;QAED,oCAAoC;QACpC,IAAI,aAAa,GAAG,KAAK,CAAA;QACzB,IAAI,OAAO,GAAG,GAAG,CAAA;QACjB,IAAI,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QACxC,OAAO,MAAM,KAAK,OAAO,EAAE,CAAC;YAC1B,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC1B,aAAa,GAAG,IAAI,CAAA;gBACpB,MAAK;YACP,CAAC;YAED,OAAO,GAAG,MAAM,CAAA;YAChB,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QACtC,CAAC;QAED,2CAA2C;QAC3C,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;YAC/B,aAAa,CAAC,GAAG,CAAC,GAAG,UAAU,CAAA;QACjC,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,KAAK,CAAC,QAAmB,EAAE,QAAgB;IACzD,IAAI,MAAM,GAAc,SAAS,CAAC,IAAI,CAAA;IAEtC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACnB,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QACpC,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QACnC,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,QAAmB,EAAE,QAAgB;IAChE,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAA;AAClE,CAAC"}
|
||||||
64
node_modules/@actions/glob/lib/internal-pattern.d.ts
generated
vendored
Normal file
64
node_modules/@actions/glob/lib/internal-pattern.d.ts
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import { MatchKind } from './internal-match-kind.js';
|
||||||
|
export declare class Pattern {
|
||||||
|
/**
|
||||||
|
* Indicates whether matches should be excluded from the result set
|
||||||
|
*/
|
||||||
|
readonly negate: boolean;
|
||||||
|
/**
|
||||||
|
* The directory to search. The literal path prior to the first glob segment.
|
||||||
|
*/
|
||||||
|
readonly searchPath: string;
|
||||||
|
/**
|
||||||
|
* The path/pattern segments. Note, only the first segment (the root directory)
|
||||||
|
* may contain a directory separator character. Use the trailingSeparator field
|
||||||
|
* to determine whether the pattern ended with a trailing slash.
|
||||||
|
*/
|
||||||
|
readonly segments: string[];
|
||||||
|
/**
|
||||||
|
* Indicates the pattern should only match directories, not regular files.
|
||||||
|
*/
|
||||||
|
readonly trailingSeparator: boolean;
|
||||||
|
/**
|
||||||
|
* The Minimatch object used for matching
|
||||||
|
*/
|
||||||
|
private readonly minimatch;
|
||||||
|
/**
|
||||||
|
* Used to workaround a limitation with Minimatch when determining a partial
|
||||||
|
* match and the path is a root directory. For example, when the pattern is
|
||||||
|
* `/foo/**` or `C:\foo\**` and the path is `/` or `C:\`.
|
||||||
|
*/
|
||||||
|
private readonly rootRegExp;
|
||||||
|
/**
|
||||||
|
* Indicates that the pattern is implicitly added as opposed to user specified.
|
||||||
|
*/
|
||||||
|
private readonly isImplicitPattern;
|
||||||
|
constructor(pattern: string);
|
||||||
|
constructor(pattern: string, isImplicitPattern: boolean, segments: undefined, homedir: string);
|
||||||
|
constructor(negate: boolean, isImplicitPattern: boolean, segments: string[], homedir?: string);
|
||||||
|
/**
|
||||||
|
* Matches the pattern against the specified path
|
||||||
|
*/
|
||||||
|
match(itemPath: string): MatchKind;
|
||||||
|
/**
|
||||||
|
* Indicates whether the pattern may match descendants of the specified path
|
||||||
|
*/
|
||||||
|
partialMatch(itemPath: string): boolean;
|
||||||
|
/**
|
||||||
|
* Escapes glob patterns within a path
|
||||||
|
*/
|
||||||
|
static globEscape(s: string): string;
|
||||||
|
/**
|
||||||
|
* Normalizes slashes and ensures absolute root
|
||||||
|
*/
|
||||||
|
private static fixupPattern;
|
||||||
|
/**
|
||||||
|
* Attempts to unescape a pattern segment to create a literal path segment.
|
||||||
|
* Otherwise returns empty string.
|
||||||
|
*/
|
||||||
|
private static getLiteral;
|
||||||
|
/**
|
||||||
|
* Escapes regexp special characters
|
||||||
|
* https://javascript.info/regexp-escaping
|
||||||
|
*/
|
||||||
|
private static regExpEscape;
|
||||||
|
}
|
||||||
230
node_modules/@actions/glob/lib/internal-pattern.js
generated
vendored
Normal file
230
node_modules/@actions/glob/lib/internal-pattern.js
generated
vendored
Normal file
@@ -0,0 +1,230 @@
|
|||||||
|
import * as os from 'os';
|
||||||
|
import * as path from 'path';
|
||||||
|
import * as pathHelper from './internal-path-helper.js';
|
||||||
|
import assert from 'assert';
|
||||||
|
import minimatch from 'minimatch';
|
||||||
|
import { MatchKind } from './internal-match-kind.js';
|
||||||
|
import { Path } from './internal-path.js';
|
||||||
|
const { Minimatch } = minimatch;
|
||||||
|
const IS_WINDOWS = process.platform === 'win32';
|
||||||
|
export class Pattern {
|
||||||
|
constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) {
|
||||||
|
/**
|
||||||
|
* Indicates whether matches should be excluded from the result set
|
||||||
|
*/
|
||||||
|
this.negate = false;
|
||||||
|
// Pattern overload
|
||||||
|
let pattern;
|
||||||
|
if (typeof patternOrNegate === 'string') {
|
||||||
|
pattern = patternOrNegate.trim();
|
||||||
|
}
|
||||||
|
// Segments overload
|
||||||
|
else {
|
||||||
|
// Convert to pattern
|
||||||
|
segments = segments || [];
|
||||||
|
assert(segments.length, `Parameter 'segments' must not empty`);
|
||||||
|
const root = Pattern.getLiteral(segments[0]);
|
||||||
|
assert(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`);
|
||||||
|
pattern = new Path(segments).toString().trim();
|
||||||
|
if (patternOrNegate) {
|
||||||
|
pattern = `!${pattern}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Negate
|
||||||
|
while (pattern.startsWith('!')) {
|
||||||
|
this.negate = !this.negate;
|
||||||
|
pattern = pattern.substr(1).trim();
|
||||||
|
}
|
||||||
|
// Normalize slashes and ensures absolute root
|
||||||
|
pattern = Pattern.fixupPattern(pattern, homedir);
|
||||||
|
// Segments
|
||||||
|
this.segments = new Path(pattern).segments;
|
||||||
|
// Trailing slash indicates the pattern should only match directories, not regular files
|
||||||
|
this.trailingSeparator = pathHelper
|
||||||
|
.normalizeSeparators(pattern)
|
||||||
|
.endsWith(path.sep);
|
||||||
|
pattern = pathHelper.safeTrimTrailingSeparator(pattern);
|
||||||
|
// Search path (literal path prior to the first glob segment)
|
||||||
|
let foundGlob = false;
|
||||||
|
const searchSegments = this.segments
|
||||||
|
.map(x => Pattern.getLiteral(x))
|
||||||
|
.filter(x => !foundGlob && !(foundGlob = x === ''));
|
||||||
|
this.searchPath = new Path(searchSegments).toString();
|
||||||
|
// Root RegExp (required when determining partial match)
|
||||||
|
this.rootRegExp = new RegExp(Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? 'i' : '');
|
||||||
|
this.isImplicitPattern = isImplicitPattern;
|
||||||
|
// Create minimatch
|
||||||
|
const minimatchOptions = {
|
||||||
|
dot: true,
|
||||||
|
nobrace: true,
|
||||||
|
nocase: IS_WINDOWS,
|
||||||
|
nocomment: true,
|
||||||
|
noext: true,
|
||||||
|
nonegate: true
|
||||||
|
};
|
||||||
|
pattern = IS_WINDOWS ? pattern.replace(/\\/g, '/') : pattern;
|
||||||
|
this.minimatch = new Minimatch(pattern, minimatchOptions);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Matches the pattern against the specified path
|
||||||
|
*/
|
||||||
|
match(itemPath) {
|
||||||
|
// Last segment is globstar?
|
||||||
|
if (this.segments[this.segments.length - 1] === '**') {
|
||||||
|
// Normalize slashes
|
||||||
|
itemPath = pathHelper.normalizeSeparators(itemPath);
|
||||||
|
// Append a trailing slash. Otherwise Minimatch will not match the directory immediately
|
||||||
|
// preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns
|
||||||
|
// false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.
|
||||||
|
if (!itemPath.endsWith(path.sep) && this.isImplicitPattern === false) {
|
||||||
|
// Note, this is safe because the constructor ensures the pattern has an absolute root.
|
||||||
|
// For example, formats like C: and C:foo on Windows are resolved to an absolute root.
|
||||||
|
itemPath = `${itemPath}${path.sep}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Normalize slashes and trim unnecessary trailing slash
|
||||||
|
itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);
|
||||||
|
}
|
||||||
|
// Match
|
||||||
|
if (this.minimatch.match(itemPath)) {
|
||||||
|
return this.trailingSeparator ? MatchKind.Directory : MatchKind.All;
|
||||||
|
}
|
||||||
|
return MatchKind.None;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Indicates whether the pattern may match descendants of the specified path
|
||||||
|
*/
|
||||||
|
partialMatch(itemPath) {
|
||||||
|
// Normalize slashes and trim unnecessary trailing slash
|
||||||
|
itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);
|
||||||
|
// matchOne does not handle root path correctly
|
||||||
|
if (pathHelper.dirname(itemPath) === itemPath) {
|
||||||
|
return this.rootRegExp.test(itemPath);
|
||||||
|
}
|
||||||
|
return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Escapes glob patterns within a path
|
||||||
|
*/
|
||||||
|
static globEscape(s) {
|
||||||
|
return (IS_WINDOWS ? s : s.replace(/\\/g, '\\\\')) // escape '\' on Linux/macOS
|
||||||
|
.replace(/(\[)(?=[^/]+\])/g, '[[]') // escape '[' when ']' follows within the path segment
|
||||||
|
.replace(/\?/g, '[?]') // escape '?'
|
||||||
|
.replace(/\*/g, '[*]'); // escape '*'
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Normalizes slashes and ensures absolute root
|
||||||
|
*/
|
||||||
|
static fixupPattern(pattern, homedir) {
|
||||||
|
// Empty
|
||||||
|
assert(pattern, 'pattern cannot be empty');
|
||||||
|
// Must not contain `.` segment, unless first segment
|
||||||
|
// Must not contain `..` segment
|
||||||
|
const literalSegments = new Path(pattern).segments.map(x => Pattern.getLiteral(x));
|
||||||
|
assert(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`);
|
||||||
|
// Must not contain globs in root, e.g. Windows UNC path \\foo\b*r
|
||||||
|
assert(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`);
|
||||||
|
// Normalize slashes
|
||||||
|
pattern = pathHelper.normalizeSeparators(pattern);
|
||||||
|
// Replace leading `.` segment
|
||||||
|
if (pattern === '.' || pattern.startsWith(`.${path.sep}`)) {
|
||||||
|
pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1);
|
||||||
|
}
|
||||||
|
// Replace leading `~` segment
|
||||||
|
else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) {
|
||||||
|
homedir = homedir || os.homedir();
|
||||||
|
assert(homedir, 'Unable to determine HOME directory');
|
||||||
|
assert(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);
|
||||||
|
pattern = Pattern.globEscape(homedir) + pattern.substr(1);
|
||||||
|
}
|
||||||
|
// Replace relative drive root, e.g. pattern is C: or C:foo
|
||||||
|
else if (IS_WINDOWS &&
|
||||||
|
(pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\]/i))) {
|
||||||
|
let root = pathHelper.ensureAbsoluteRoot('C:\\dummy-root', pattern.substr(0, 2));
|
||||||
|
if (pattern.length > 2 && !root.endsWith('\\')) {
|
||||||
|
root += '\\';
|
||||||
|
}
|
||||||
|
pattern = Pattern.globEscape(root) + pattern.substr(2);
|
||||||
|
}
|
||||||
|
// Replace relative root, e.g. pattern is \ or \foo
|
||||||
|
else if (IS_WINDOWS && (pattern === '\\' || pattern.match(/^\\[^\\]/))) {
|
||||||
|
let root = pathHelper.ensureAbsoluteRoot('C:\\dummy-root', '\\');
|
||||||
|
if (!root.endsWith('\\')) {
|
||||||
|
root += '\\';
|
||||||
|
}
|
||||||
|
pattern = Pattern.globEscape(root) + pattern.substr(1);
|
||||||
|
}
|
||||||
|
// Otherwise ensure absolute root
|
||||||
|
else {
|
||||||
|
pattern = pathHelper.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()), pattern);
|
||||||
|
}
|
||||||
|
return pathHelper.normalizeSeparators(pattern);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Attempts to unescape a pattern segment to create a literal path segment.
|
||||||
|
* Otherwise returns empty string.
|
||||||
|
*/
|
||||||
|
static getLiteral(segment) {
|
||||||
|
let literal = '';
|
||||||
|
for (let i = 0; i < segment.length; i++) {
|
||||||
|
const c = segment[i];
|
||||||
|
// Escape
|
||||||
|
if (c === '\\' && !IS_WINDOWS && i + 1 < segment.length) {
|
||||||
|
literal += segment[++i];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// Wildcard
|
||||||
|
else if (c === '*' || c === '?') {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
// Character set
|
||||||
|
else if (c === '[' && i + 1 < segment.length) {
|
||||||
|
let set = '';
|
||||||
|
let closed = -1;
|
||||||
|
for (let i2 = i + 1; i2 < segment.length; i2++) {
|
||||||
|
const c2 = segment[i2];
|
||||||
|
// Escape
|
||||||
|
if (c2 === '\\' && !IS_WINDOWS && i2 + 1 < segment.length) {
|
||||||
|
set += segment[++i2];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// Closed
|
||||||
|
else if (c2 === ']') {
|
||||||
|
closed = i2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Otherwise
|
||||||
|
else {
|
||||||
|
set += c2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Closed?
|
||||||
|
if (closed >= 0) {
|
||||||
|
// Cannot convert
|
||||||
|
if (set.length > 1) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
// Convert to literal
|
||||||
|
if (set) {
|
||||||
|
literal += set;
|
||||||
|
i = closed;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Otherwise fall thru
|
||||||
|
}
|
||||||
|
// Append
|
||||||
|
literal += c;
|
||||||
|
}
|
||||||
|
return literal;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Escapes regexp special characters
|
||||||
|
* https://javascript.info/regexp-escaping
|
||||||
|
*/
|
||||||
|
static regExpEscape(s) {
|
||||||
|
return s.replace(/[[\\^$.|?*+()]/g, '\\$&');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=internal-pattern.js.map
|
||||||
1
node_modules/@actions/glob/lib/internal-pattern.js.map
generated
vendored
Normal file
1
node_modules/@actions/glob/lib/internal-pattern.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
node_modules/@actions/glob/lib/internal-search-state.d.ts
generated
vendored
Normal file
5
node_modules/@actions/glob/lib/internal-search-state.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export declare class SearchState {
|
||||||
|
readonly path: string;
|
||||||
|
readonly level: number;
|
||||||
|
constructor(path: string, level: number);
|
||||||
|
}
|
||||||
7
node_modules/@actions/glob/lib/internal-search-state.js
generated
vendored
Normal file
7
node_modules/@actions/glob/lib/internal-search-state.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export class SearchState {
|
||||||
|
constructor(path, level) {
|
||||||
|
this.path = path;
|
||||||
|
this.level = level;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=internal-search-state.js.map
|
||||||
1
node_modules/@actions/glob/lib/internal-search-state.js.map
generated
vendored
Normal file
1
node_modules/@actions/glob/lib/internal-search-state.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"internal-search-state.js","sourceRoot":"","sources":["../src/internal-search-state.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,WAAW;IAItB,YAAY,IAAY,EAAE,KAAa;QACrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;CACF"}
|
||||||
50
node_modules/@actions/glob/package.json
generated
vendored
Normal file
50
node_modules/@actions/glob/package.json
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
{
|
||||||
|
"name": "@actions/glob",
|
||||||
|
"version": "0.6.1",
|
||||||
|
"preview": true,
|
||||||
|
"description": "Actions glob lib",
|
||||||
|
"keywords": [
|
||||||
|
"github",
|
||||||
|
"actions",
|
||||||
|
"glob"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/actions/toolkit/tree/main/packages/glob",
|
||||||
|
"license": "MIT",
|
||||||
|
"type": "module",
|
||||||
|
"main": "lib/glob.js",
|
||||||
|
"types": "lib/glob.d.ts",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"types": "./lib/glob.d.ts",
|
||||||
|
"import": "./lib/glob.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"lib": "lib",
|
||||||
|
"test": "__tests__"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"lib",
|
||||||
|
"!.DS_Store"
|
||||||
|
],
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/actions/toolkit.git",
|
||||||
|
"directory": "packages/glob"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
|
||||||
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||||
|
"tsc": "tsc"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@actions/core": "^3.0.0",
|
||||||
|
"minimatch": "^3.0.4"
|
||||||
|
}
|
||||||
|
}
|
||||||
21
node_modules/@actions/http-client/LICENSE
generated
vendored
Normal file
21
node_modules/@actions/http-client/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
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.
|
||||||
73
node_modules/@actions/http-client/README.md
generated
vendored
Normal file
73
node_modules/@actions/http-client/README.md
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
# `@actions/http-client`
|
||||||
|
|
||||||
|
A lightweight HTTP client optimized for building actions.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- HTTP client with TypeScript generics and async/await/Promises
|
||||||
|
- Typings included!
|
||||||
|
- [Proxy support](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners#using-a-proxy-server-with-self-hosted-runners) just works with actions and the runner
|
||||||
|
- Targets ES2019 (runner runs actions with node 24+). Only supported on node 20+.
|
||||||
|
- Basic, Bearer and PAT Support out of the box. Extensible handlers for others.
|
||||||
|
- Redirects supported
|
||||||
|
|
||||||
|
Features and releases [here](./RELEASES.md)
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install @actions/http-client --save
|
||||||
|
```
|
||||||
|
|
||||||
|
## Samples
|
||||||
|
|
||||||
|
See the [tests](./__tests__) for detailed examples.
|
||||||
|
|
||||||
|
## Errors
|
||||||
|
|
||||||
|
### HTTP
|
||||||
|
|
||||||
|
The HTTP client does not throw unless truly exceptional.
|
||||||
|
|
||||||
|
* A request that successfully executes resulting in a 404, 500 etc... will return a response object with a status code and a body.
|
||||||
|
* Redirects (3xx) will be followed by default.
|
||||||
|
|
||||||
|
See the [tests](./__tests__) for detailed examples.
|
||||||
|
|
||||||
|
## Debugging
|
||||||
|
|
||||||
|
To enable detailed console logging of all HTTP requests and responses, set the NODE_DEBUG environment varible:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
export NODE_DEBUG=http
|
||||||
|
```
|
||||||
|
|
||||||
|
## Node support
|
||||||
|
|
||||||
|
The http-client is built using Node 24. It may work on previous node LTS versions but it's tested and officially supported on Node 20+.
|
||||||
|
|
||||||
|
## Support and Versioning
|
||||||
|
|
||||||
|
We follow semver and will hold compatibility between major versions and increment the minor version with new features and capabilities (while holding compat).
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
We welcome PRs. Please create an issue and if applicable, a design before proceeding with code.
|
||||||
|
|
||||||
|
once:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
To build:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
To run all tests:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm test
|
||||||
|
```
|
||||||
25
node_modules/@actions/http-client/lib/auth.d.ts
generated
vendored
Normal file
25
node_modules/@actions/http-client/lib/auth.d.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import * as http from 'http';
|
||||||
|
import * as ifm from './interfaces.js';
|
||||||
|
import { HttpClientResponse } from './index.js';
|
||||||
|
export declare class BasicCredentialHandler implements ifm.RequestHandler {
|
||||||
|
username: string;
|
||||||
|
password: string;
|
||||||
|
constructor(username: string, password: string);
|
||||||
|
prepareRequest(options: http.RequestOptions): void;
|
||||||
|
canHandleAuthentication(): boolean;
|
||||||
|
handleAuthentication(): Promise<HttpClientResponse>;
|
||||||
|
}
|
||||||
|
export declare class BearerCredentialHandler implements ifm.RequestHandler {
|
||||||
|
token: string;
|
||||||
|
constructor(token: string);
|
||||||
|
prepareRequest(options: http.RequestOptions): void;
|
||||||
|
canHandleAuthentication(): boolean;
|
||||||
|
handleAuthentication(): Promise<HttpClientResponse>;
|
||||||
|
}
|
||||||
|
export declare class PersonalAccessTokenCredentialHandler implements ifm.RequestHandler {
|
||||||
|
token: string;
|
||||||
|
constructor(token: string);
|
||||||
|
prepareRequest(options: http.RequestOptions): void;
|
||||||
|
canHandleAuthentication(): boolean;
|
||||||
|
handleAuthentication(): Promise<HttpClientResponse>;
|
||||||
|
}
|
||||||
75
node_modules/@actions/http-client/lib/auth.js
generated
vendored
Normal file
75
node_modules/@actions/http-client/lib/auth.js
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
export class BasicCredentialHandler {
|
||||||
|
constructor(username, password) {
|
||||||
|
this.username = username;
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
prepareRequest(options) {
|
||||||
|
if (!options.headers) {
|
||||||
|
throw Error('The request has no headers');
|
||||||
|
}
|
||||||
|
options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
|
||||||
|
}
|
||||||
|
// This handler cannot handle 401
|
||||||
|
canHandleAuthentication() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
handleAuthentication() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
throw new Error('not implemented');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export class BearerCredentialHandler {
|
||||||
|
constructor(token) {
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
// currently implements pre-authorization
|
||||||
|
// TODO: support preAuth = false where it hooks on 401
|
||||||
|
prepareRequest(options) {
|
||||||
|
if (!options.headers) {
|
||||||
|
throw Error('The request has no headers');
|
||||||
|
}
|
||||||
|
options.headers['Authorization'] = `Bearer ${this.token}`;
|
||||||
|
}
|
||||||
|
// This handler cannot handle 401
|
||||||
|
canHandleAuthentication() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
handleAuthentication() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
throw new Error('not implemented');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export class PersonalAccessTokenCredentialHandler {
|
||||||
|
constructor(token) {
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
// currently implements pre-authorization
|
||||||
|
// TODO: support preAuth = false where it hooks on 401
|
||||||
|
prepareRequest(options) {
|
||||||
|
if (!options.headers) {
|
||||||
|
throw Error('The request has no headers');
|
||||||
|
}
|
||||||
|
options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
|
||||||
|
}
|
||||||
|
// This handler cannot handle 401
|
||||||
|
canHandleAuthentication() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
handleAuthentication() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
throw new Error('not implemented');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=auth.js.map
|
||||||
1
node_modules/@actions/http-client/lib/auth.js.map
generated
vendored
Normal file
1
node_modules/@actions/http-client/lib/auth.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":";;;;;;;;;AAIA,MAAM,OAAO,sBAAsB;IAIjC,YAAY,QAAgB,EAAE,QAAgB;QAC5C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;IAED,cAAc,CAAC,OAA4B;QACzC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YACrB,MAAM,KAAK,CAAC,4BAA4B,CAAC,CAAA;QAC3C,CAAC;QACD,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,SAAS,MAAM,CAAC,IAAI,CACrD,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE,CACpC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAA;IACxB,CAAC;IAED,iCAAiC;IACjC,uBAAuB;QACrB,OAAO,KAAK,CAAA;IACd,CAAC;IAEK,oBAAoB;;YACxB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;QACpC,CAAC;KAAA;CACF;AAED,MAAM,OAAO,uBAAuB;IAGlC,YAAY,KAAa;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,yCAAyC;IACzC,sDAAsD;IACtD,cAAc,CAAC,OAA4B;QACzC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YACrB,MAAM,KAAK,CAAC,4BAA4B,CAAC,CAAA;QAC3C,CAAC;QACD,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,IAAI,CAAC,KAAK,EAAE,CAAA;IAC3D,CAAC;IAED,iCAAiC;IACjC,uBAAuB;QACrB,OAAO,KAAK,CAAA;IACd,CAAC;IAEK,oBAAoB;;YACxB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;QACpC,CAAC;KAAA;CACF;AAED,MAAM,OAAO,oCAAoC;IAK/C,YAAY,KAAa;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,yCAAyC;IACzC,sDAAsD;IACtD,cAAc,CAAC,OAA4B;QACzC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YACrB,MAAM,KAAK,CAAC,4BAA4B,CAAC,CAAA;QAC3C,CAAC;QACD,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,SAAS,MAAM,CAAC,IAAI,CACrD,OAAO,IAAI,CAAC,KAAK,EAAE,CACpB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAA;IACxB,CAAC;IAED,iCAAiC;IACjC,uBAAuB;QACrB,OAAO,KAAK,CAAA;IACd,CAAC;IAEK,oBAAoB;;YACxB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;QACpC,CAAC;KAAA;CACF"}
|
||||||
143
node_modules/@actions/http-client/lib/index.d.ts
generated
vendored
Normal file
143
node_modules/@actions/http-client/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
import * as http from 'http';
|
||||||
|
import * as ifm from './interfaces.js';
|
||||||
|
import { ProxyAgent } from 'undici';
|
||||||
|
export declare enum HttpCodes {
|
||||||
|
OK = 200,
|
||||||
|
MultipleChoices = 300,
|
||||||
|
MovedPermanently = 301,
|
||||||
|
ResourceMoved = 302,
|
||||||
|
SeeOther = 303,
|
||||||
|
NotModified = 304,
|
||||||
|
UseProxy = 305,
|
||||||
|
SwitchProxy = 306,
|
||||||
|
TemporaryRedirect = 307,
|
||||||
|
PermanentRedirect = 308,
|
||||||
|
BadRequest = 400,
|
||||||
|
Unauthorized = 401,
|
||||||
|
PaymentRequired = 402,
|
||||||
|
Forbidden = 403,
|
||||||
|
NotFound = 404,
|
||||||
|
MethodNotAllowed = 405,
|
||||||
|
NotAcceptable = 406,
|
||||||
|
ProxyAuthenticationRequired = 407,
|
||||||
|
RequestTimeout = 408,
|
||||||
|
Conflict = 409,
|
||||||
|
Gone = 410,
|
||||||
|
TooManyRequests = 429,
|
||||||
|
InternalServerError = 500,
|
||||||
|
NotImplemented = 501,
|
||||||
|
BadGateway = 502,
|
||||||
|
ServiceUnavailable = 503,
|
||||||
|
GatewayTimeout = 504
|
||||||
|
}
|
||||||
|
export declare enum Headers {
|
||||||
|
Accept = "accept",
|
||||||
|
ContentType = "content-type"
|
||||||
|
}
|
||||||
|
export declare enum MediaTypes {
|
||||||
|
ApplicationJson = "application/json"
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns the proxy URL, depending upon the supplied url and proxy environment variables.
|
||||||
|
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
||||||
|
*/
|
||||||
|
export declare function getProxyUrl(serverUrl: string): string;
|
||||||
|
export declare class HttpClientError extends Error {
|
||||||
|
constructor(message: string, statusCode: number);
|
||||||
|
statusCode: number;
|
||||||
|
result?: any;
|
||||||
|
}
|
||||||
|
export declare class HttpClientResponse {
|
||||||
|
constructor(message: http.IncomingMessage);
|
||||||
|
message: http.IncomingMessage;
|
||||||
|
readBody(): Promise<string>;
|
||||||
|
readBodyBuffer?(): Promise<Buffer>;
|
||||||
|
}
|
||||||
|
export declare function isHttps(requestUrl: string): boolean;
|
||||||
|
export declare class HttpClient {
|
||||||
|
userAgent: string | undefined;
|
||||||
|
handlers: ifm.RequestHandler[];
|
||||||
|
requestOptions: ifm.RequestOptions | undefined;
|
||||||
|
private _ignoreSslError;
|
||||||
|
private _socketTimeout;
|
||||||
|
private _allowRedirects;
|
||||||
|
private _allowRedirectDowngrade;
|
||||||
|
private _maxRedirects;
|
||||||
|
private _allowRetries;
|
||||||
|
private _maxRetries;
|
||||||
|
private _agent;
|
||||||
|
private _proxyAgent;
|
||||||
|
private _proxyAgentDispatcher;
|
||||||
|
private _keepAlive;
|
||||||
|
private _disposed;
|
||||||
|
constructor(userAgent?: string, handlers?: ifm.RequestHandler[], requestOptions?: ifm.RequestOptions);
|
||||||
|
options(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
||||||
|
get(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
||||||
|
del(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
||||||
|
post(requestUrl: string, data: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
||||||
|
patch(requestUrl: string, data: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
||||||
|
put(requestUrl: string, data: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
||||||
|
head(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
||||||
|
sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
||||||
|
/**
|
||||||
|
* Gets a typed object from an endpoint
|
||||||
|
* Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
|
||||||
|
*/
|
||||||
|
getJson<T>(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<ifm.TypedResponse<T>>;
|
||||||
|
postJson<T>(requestUrl: string, obj: any, additionalHeaders?: http.OutgoingHttpHeaders): Promise<ifm.TypedResponse<T>>;
|
||||||
|
putJson<T>(requestUrl: string, obj: any, additionalHeaders?: http.OutgoingHttpHeaders): Promise<ifm.TypedResponse<T>>;
|
||||||
|
patchJson<T>(requestUrl: string, obj: any, additionalHeaders?: http.OutgoingHttpHeaders): Promise<ifm.TypedResponse<T>>;
|
||||||
|
/**
|
||||||
|
* Makes a raw http request.
|
||||||
|
* All other methods such as get, post, patch, and request ultimately call this.
|
||||||
|
* Prefer get, del, post and patch
|
||||||
|
*/
|
||||||
|
request(verb: string, requestUrl: string, data: string | NodeJS.ReadableStream | null, headers?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
||||||
|
/**
|
||||||
|
* Needs to be called if keepAlive is set to true in request options.
|
||||||
|
*/
|
||||||
|
dispose(): void;
|
||||||
|
/**
|
||||||
|
* Raw request.
|
||||||
|
* @param info
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
requestRaw(info: ifm.RequestInfo, data: string | NodeJS.ReadableStream | null): Promise<HttpClientResponse>;
|
||||||
|
/**
|
||||||
|
* Raw request with callback.
|
||||||
|
* @param info
|
||||||
|
* @param data
|
||||||
|
* @param onResult
|
||||||
|
*/
|
||||||
|
requestRawWithCallback(info: ifm.RequestInfo, data: string | NodeJS.ReadableStream | null, onResult: (err?: Error, res?: HttpClientResponse) => void): void;
|
||||||
|
/**
|
||||||
|
* Gets an http agent. This function is useful when you need an http agent that handles
|
||||||
|
* routing through a proxy server - depending upon the url and proxy environment variables.
|
||||||
|
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
||||||
|
*/
|
||||||
|
getAgent(serverUrl: string): http.Agent;
|
||||||
|
getAgentDispatcher(serverUrl: string): ProxyAgent | undefined;
|
||||||
|
private _prepareRequest;
|
||||||
|
private _mergeHeaders;
|
||||||
|
/**
|
||||||
|
* Gets an existing header value or returns a default.
|
||||||
|
* Handles converting number header values to strings since HTTP headers must be strings.
|
||||||
|
* Note: This returns string | string[] since some headers can have multiple values.
|
||||||
|
* For headers that must always be a single string (like Content-Type), use the
|
||||||
|
* specialized _getExistingOrDefaultContentTypeHeader method instead.
|
||||||
|
*/
|
||||||
|
private _getExistingOrDefaultHeader;
|
||||||
|
/**
|
||||||
|
* Specialized version of _getExistingOrDefaultHeader for Content-Type header.
|
||||||
|
* Always returns a single string (not an array) since Content-Type should be a single value.
|
||||||
|
* Converts arrays to comma-separated strings and numbers to strings to ensure type safety.
|
||||||
|
* This was split from _getExistingOrDefaultHeader to provide stricter typing for callers
|
||||||
|
* that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]).
|
||||||
|
*/
|
||||||
|
private _getExistingOrDefaultContentTypeHeader;
|
||||||
|
private _getAgent;
|
||||||
|
private _getProxyAgentDispatcher;
|
||||||
|
private _getUserAgentWithOrchestrationId;
|
||||||
|
private _performExponentialBackoff;
|
||||||
|
private _processResponse;
|
||||||
|
}
|
||||||
696
node_modules/@actions/http-client/lib/index.js
generated
vendored
Normal file
696
node_modules/@actions/http-client/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,696 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
import * as http from 'http';
|
||||||
|
import * as https from 'https';
|
||||||
|
import * as pm from './proxy.js';
|
||||||
|
import * as tunnel from 'tunnel';
|
||||||
|
import { ProxyAgent } from 'undici';
|
||||||
|
export var HttpCodes;
|
||||||
|
(function (HttpCodes) {
|
||||||
|
HttpCodes[HttpCodes["OK"] = 200] = "OK";
|
||||||
|
HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
|
||||||
|
HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
|
||||||
|
HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
|
||||||
|
HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
|
||||||
|
HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
|
||||||
|
HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
|
||||||
|
HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
|
||||||
|
HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
|
||||||
|
HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
|
||||||
|
HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
|
||||||
|
HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
|
||||||
|
HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
|
||||||
|
HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
|
||||||
|
HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
|
||||||
|
HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
|
||||||
|
HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
|
||||||
|
HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
|
||||||
|
HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
|
||||||
|
HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
|
||||||
|
HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
|
||||||
|
HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
|
||||||
|
HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
|
||||||
|
HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
|
||||||
|
HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
|
||||||
|
HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
|
||||||
|
HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
|
||||||
|
})(HttpCodes || (HttpCodes = {}));
|
||||||
|
export var Headers;
|
||||||
|
(function (Headers) {
|
||||||
|
Headers["Accept"] = "accept";
|
||||||
|
Headers["ContentType"] = "content-type";
|
||||||
|
})(Headers || (Headers = {}));
|
||||||
|
export var MediaTypes;
|
||||||
|
(function (MediaTypes) {
|
||||||
|
MediaTypes["ApplicationJson"] = "application/json";
|
||||||
|
})(MediaTypes || (MediaTypes = {}));
|
||||||
|
/**
|
||||||
|
* Returns the proxy URL, depending upon the supplied url and proxy environment variables.
|
||||||
|
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
||||||
|
*/
|
||||||
|
export function getProxyUrl(serverUrl) {
|
||||||
|
const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
|
||||||
|
return proxyUrl ? proxyUrl.href : '';
|
||||||
|
}
|
||||||
|
const HttpRedirectCodes = [
|
||||||
|
HttpCodes.MovedPermanently,
|
||||||
|
HttpCodes.ResourceMoved,
|
||||||
|
HttpCodes.SeeOther,
|
||||||
|
HttpCodes.TemporaryRedirect,
|
||||||
|
HttpCodes.PermanentRedirect
|
||||||
|
];
|
||||||
|
const HttpResponseRetryCodes = [
|
||||||
|
HttpCodes.BadGateway,
|
||||||
|
HttpCodes.ServiceUnavailable,
|
||||||
|
HttpCodes.GatewayTimeout
|
||||||
|
];
|
||||||
|
const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
|
||||||
|
const ExponentialBackoffCeiling = 10;
|
||||||
|
const ExponentialBackoffTimeSlice = 5;
|
||||||
|
export class HttpClientError extends Error {
|
||||||
|
constructor(message, statusCode) {
|
||||||
|
super(message);
|
||||||
|
this.name = 'HttpClientError';
|
||||||
|
this.statusCode = statusCode;
|
||||||
|
Object.setPrototypeOf(this, HttpClientError.prototype);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export class HttpClientResponse {
|
||||||
|
constructor(message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
readBody() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let output = Buffer.alloc(0);
|
||||||
|
this.message.on('data', (chunk) => {
|
||||||
|
output = Buffer.concat([output, chunk]);
|
||||||
|
});
|
||||||
|
this.message.on('end', () => {
|
||||||
|
resolve(output.toString());
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
readBodyBuffer() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const chunks = [];
|
||||||
|
this.message.on('data', (chunk) => {
|
||||||
|
chunks.push(chunk);
|
||||||
|
});
|
||||||
|
this.message.on('end', () => {
|
||||||
|
resolve(Buffer.concat(chunks));
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export function isHttps(requestUrl) {
|
||||||
|
const parsedUrl = new URL(requestUrl);
|
||||||
|
return parsedUrl.protocol === 'https:';
|
||||||
|
}
|
||||||
|
export class HttpClient {
|
||||||
|
constructor(userAgent, handlers, requestOptions) {
|
||||||
|
this._ignoreSslError = false;
|
||||||
|
this._allowRedirects = true;
|
||||||
|
this._allowRedirectDowngrade = false;
|
||||||
|
this._maxRedirects = 50;
|
||||||
|
this._allowRetries = false;
|
||||||
|
this._maxRetries = 1;
|
||||||
|
this._keepAlive = false;
|
||||||
|
this._disposed = false;
|
||||||
|
this.userAgent = this._getUserAgentWithOrchestrationId(userAgent);
|
||||||
|
this.handlers = handlers || [];
|
||||||
|
this.requestOptions = requestOptions;
|
||||||
|
if (requestOptions) {
|
||||||
|
if (requestOptions.ignoreSslError != null) {
|
||||||
|
this._ignoreSslError = requestOptions.ignoreSslError;
|
||||||
|
}
|
||||||
|
this._socketTimeout = requestOptions.socketTimeout;
|
||||||
|
if (requestOptions.allowRedirects != null) {
|
||||||
|
this._allowRedirects = requestOptions.allowRedirects;
|
||||||
|
}
|
||||||
|
if (requestOptions.allowRedirectDowngrade != null) {
|
||||||
|
this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
|
||||||
|
}
|
||||||
|
if (requestOptions.maxRedirects != null) {
|
||||||
|
this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
|
||||||
|
}
|
||||||
|
if (requestOptions.keepAlive != null) {
|
||||||
|
this._keepAlive = requestOptions.keepAlive;
|
||||||
|
}
|
||||||
|
if (requestOptions.allowRetries != null) {
|
||||||
|
this._allowRetries = requestOptions.allowRetries;
|
||||||
|
}
|
||||||
|
if (requestOptions.maxRetries != null) {
|
||||||
|
this._maxRetries = requestOptions.maxRetries;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
options(requestUrl, additionalHeaders) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
get(requestUrl, additionalHeaders) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return this.request('GET', requestUrl, null, additionalHeaders || {});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
del(requestUrl, additionalHeaders) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return this.request('DELETE', requestUrl, null, additionalHeaders || {});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
post(requestUrl, data, additionalHeaders) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return this.request('POST', requestUrl, data, additionalHeaders || {});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
patch(requestUrl, data, additionalHeaders) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return this.request('PATCH', requestUrl, data, additionalHeaders || {});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
put(requestUrl, data, additionalHeaders) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return this.request('PUT', requestUrl, data, additionalHeaders || {});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
head(requestUrl, additionalHeaders) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return this.request('HEAD', requestUrl, null, additionalHeaders || {});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
sendStream(verb, requestUrl, stream, additionalHeaders) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return this.request(verb, requestUrl, stream, additionalHeaders);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Gets a typed object from an endpoint
|
||||||
|
* Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
|
||||||
|
*/
|
||||||
|
getJson(requestUrl_1) {
|
||||||
|
return __awaiter(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) {
|
||||||
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
||||||
|
const res = yield this.get(requestUrl, additionalHeaders);
|
||||||
|
return this._processResponse(res, this.requestOptions);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
postJson(requestUrl_1, obj_1) {
|
||||||
|
return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {
|
||||||
|
const data = JSON.stringify(obj, null, 2);
|
||||||
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
||||||
|
additionalHeaders[Headers.ContentType] =
|
||||||
|
this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);
|
||||||
|
const res = yield this.post(requestUrl, data, additionalHeaders);
|
||||||
|
return this._processResponse(res, this.requestOptions);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
putJson(requestUrl_1, obj_1) {
|
||||||
|
return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {
|
||||||
|
const data = JSON.stringify(obj, null, 2);
|
||||||
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
||||||
|
additionalHeaders[Headers.ContentType] =
|
||||||
|
this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);
|
||||||
|
const res = yield this.put(requestUrl, data, additionalHeaders);
|
||||||
|
return this._processResponse(res, this.requestOptions);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
patchJson(requestUrl_1, obj_1) {
|
||||||
|
return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {
|
||||||
|
const data = JSON.stringify(obj, null, 2);
|
||||||
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
||||||
|
additionalHeaders[Headers.ContentType] =
|
||||||
|
this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);
|
||||||
|
const res = yield this.patch(requestUrl, data, additionalHeaders);
|
||||||
|
return this._processResponse(res, this.requestOptions);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Makes a raw http request.
|
||||||
|
* All other methods such as get, post, patch, and request ultimately call this.
|
||||||
|
* Prefer get, del, post and patch
|
||||||
|
*/
|
||||||
|
request(verb, requestUrl, data, headers) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if (this._disposed) {
|
||||||
|
throw new Error('Client has already been disposed.');
|
||||||
|
}
|
||||||
|
const parsedUrl = new URL(requestUrl);
|
||||||
|
let info = this._prepareRequest(verb, parsedUrl, headers);
|
||||||
|
// Only perform retries on reads since writes may not be idempotent.
|
||||||
|
const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
|
||||||
|
? this._maxRetries + 1
|
||||||
|
: 1;
|
||||||
|
let numTries = 0;
|
||||||
|
let response;
|
||||||
|
do {
|
||||||
|
response = yield this.requestRaw(info, data);
|
||||||
|
// Check if it's an authentication challenge
|
||||||
|
if (response &&
|
||||||
|
response.message &&
|
||||||
|
response.message.statusCode === HttpCodes.Unauthorized) {
|
||||||
|
let authenticationHandler;
|
||||||
|
for (const handler of this.handlers) {
|
||||||
|
if (handler.canHandleAuthentication(response)) {
|
||||||
|
authenticationHandler = handler;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (authenticationHandler) {
|
||||||
|
return authenticationHandler.handleAuthentication(this, info, data);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// We have received an unauthorized response but have no handlers to handle it.
|
||||||
|
// Let the response return to the caller.
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let redirectsRemaining = this._maxRedirects;
|
||||||
|
while (response.message.statusCode &&
|
||||||
|
HttpRedirectCodes.includes(response.message.statusCode) &&
|
||||||
|
this._allowRedirects &&
|
||||||
|
redirectsRemaining > 0) {
|
||||||
|
const redirectUrl = response.message.headers['location'];
|
||||||
|
if (!redirectUrl) {
|
||||||
|
// if there's no location to redirect to, we won't
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
const parsedRedirectUrl = new URL(redirectUrl);
|
||||||
|
if (parsedUrl.protocol === 'https:' &&
|
||||||
|
parsedUrl.protocol !== parsedRedirectUrl.protocol &&
|
||||||
|
!this._allowRedirectDowngrade) {
|
||||||
|
throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');
|
||||||
|
}
|
||||||
|
// we need to finish reading the response before reassigning response
|
||||||
|
// which will leak the open socket.
|
||||||
|
yield response.readBody();
|
||||||
|
// strip authorization header if redirected to a different hostname
|
||||||
|
if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
|
||||||
|
for (const header in headers) {
|
||||||
|
// header names are case insensitive
|
||||||
|
if (header.toLowerCase() === 'authorization') {
|
||||||
|
delete headers[header];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// let's make the request with the new redirectUrl
|
||||||
|
info = this._prepareRequest(verb, parsedRedirectUrl, headers);
|
||||||
|
response = yield this.requestRaw(info, data);
|
||||||
|
redirectsRemaining--;
|
||||||
|
}
|
||||||
|
if (!response.message.statusCode ||
|
||||||
|
!HttpResponseRetryCodes.includes(response.message.statusCode)) {
|
||||||
|
// If not a retry code, return immediately instead of retrying
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
numTries += 1;
|
||||||
|
if (numTries < maxTries) {
|
||||||
|
yield response.readBody();
|
||||||
|
yield this._performExponentialBackoff(numTries);
|
||||||
|
}
|
||||||
|
} while (numTries < maxTries);
|
||||||
|
return response;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Needs to be called if keepAlive is set to true in request options.
|
||||||
|
*/
|
||||||
|
dispose() {
|
||||||
|
if (this._agent) {
|
||||||
|
this._agent.destroy();
|
||||||
|
}
|
||||||
|
this._disposed = true;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Raw request.
|
||||||
|
* @param info
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
requestRaw(info, data) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
function callbackForResult(err, res) {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else if (!res) {
|
||||||
|
// If `err` is not passed, then `res` must be passed.
|
||||||
|
reject(new Error('Unknown error'));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.requestRawWithCallback(info, data, callbackForResult);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Raw request with callback.
|
||||||
|
* @param info
|
||||||
|
* @param data
|
||||||
|
* @param onResult
|
||||||
|
*/
|
||||||
|
requestRawWithCallback(info, data, onResult) {
|
||||||
|
if (typeof data === 'string') {
|
||||||
|
if (!info.options.headers) {
|
||||||
|
info.options.headers = {};
|
||||||
|
}
|
||||||
|
info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
|
||||||
|
}
|
||||||
|
let callbackCalled = false;
|
||||||
|
function handleResult(err, res) {
|
||||||
|
if (!callbackCalled) {
|
||||||
|
callbackCalled = true;
|
||||||
|
onResult(err, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const req = info.httpModule.request(info.options, (msg) => {
|
||||||
|
const res = new HttpClientResponse(msg);
|
||||||
|
handleResult(undefined, res);
|
||||||
|
});
|
||||||
|
let socket;
|
||||||
|
req.on('socket', sock => {
|
||||||
|
socket = sock;
|
||||||
|
});
|
||||||
|
// If we ever get disconnected, we want the socket to timeout eventually
|
||||||
|
req.setTimeout(this._socketTimeout || 3 * 60000, () => {
|
||||||
|
if (socket) {
|
||||||
|
socket.end();
|
||||||
|
}
|
||||||
|
handleResult(new Error(`Request timeout: ${info.options.path}`));
|
||||||
|
});
|
||||||
|
req.on('error', function (err) {
|
||||||
|
// err has statusCode property
|
||||||
|
// res should have headers
|
||||||
|
handleResult(err);
|
||||||
|
});
|
||||||
|
if (data && typeof data === 'string') {
|
||||||
|
req.write(data, 'utf8');
|
||||||
|
}
|
||||||
|
if (data && typeof data !== 'string') {
|
||||||
|
data.on('close', function () {
|
||||||
|
req.end();
|
||||||
|
});
|
||||||
|
data.pipe(req);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
req.end();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Gets an http agent. This function is useful when you need an http agent that handles
|
||||||
|
* routing through a proxy server - depending upon the url and proxy environment variables.
|
||||||
|
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
||||||
|
*/
|
||||||
|
getAgent(serverUrl) {
|
||||||
|
const parsedUrl = new URL(serverUrl);
|
||||||
|
return this._getAgent(parsedUrl);
|
||||||
|
}
|
||||||
|
getAgentDispatcher(serverUrl) {
|
||||||
|
const parsedUrl = new URL(serverUrl);
|
||||||
|
const proxyUrl = pm.getProxyUrl(parsedUrl);
|
||||||
|
const useProxy = proxyUrl && proxyUrl.hostname;
|
||||||
|
if (!useProxy) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
|
||||||
|
}
|
||||||
|
_prepareRequest(method, requestUrl, headers) {
|
||||||
|
const info = {};
|
||||||
|
info.parsedUrl = requestUrl;
|
||||||
|
const usingSsl = info.parsedUrl.protocol === 'https:';
|
||||||
|
info.httpModule = usingSsl ? https : http;
|
||||||
|
const defaultPort = usingSsl ? 443 : 80;
|
||||||
|
info.options = {};
|
||||||
|
info.options.host = info.parsedUrl.hostname;
|
||||||
|
info.options.port = info.parsedUrl.port
|
||||||
|
? parseInt(info.parsedUrl.port)
|
||||||
|
: defaultPort;
|
||||||
|
info.options.path =
|
||||||
|
(info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
|
||||||
|
info.options.method = method;
|
||||||
|
info.options.headers = this._mergeHeaders(headers);
|
||||||
|
if (this.userAgent != null) {
|
||||||
|
info.options.headers['user-agent'] = this.userAgent;
|
||||||
|
}
|
||||||
|
info.options.agent = this._getAgent(info.parsedUrl);
|
||||||
|
// gives handlers an opportunity to participate
|
||||||
|
if (this.handlers) {
|
||||||
|
for (const handler of this.handlers) {
|
||||||
|
handler.prepareRequest(info.options);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
_mergeHeaders(headers) {
|
||||||
|
if (this.requestOptions && this.requestOptions.headers) {
|
||||||
|
return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
|
||||||
|
}
|
||||||
|
return lowercaseKeys(headers || {});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Gets an existing header value or returns a default.
|
||||||
|
* Handles converting number header values to strings since HTTP headers must be strings.
|
||||||
|
* Note: This returns string | string[] since some headers can have multiple values.
|
||||||
|
* For headers that must always be a single string (like Content-Type), use the
|
||||||
|
* specialized _getExistingOrDefaultContentTypeHeader method instead.
|
||||||
|
*/
|
||||||
|
_getExistingOrDefaultHeader(additionalHeaders, header, _default) {
|
||||||
|
let clientHeader;
|
||||||
|
if (this.requestOptions && this.requestOptions.headers) {
|
||||||
|
const headerValue = lowercaseKeys(this.requestOptions.headers)[header];
|
||||||
|
if (headerValue) {
|
||||||
|
clientHeader =
|
||||||
|
typeof headerValue === 'number' ? headerValue.toString() : headerValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const additionalValue = additionalHeaders[header];
|
||||||
|
if (additionalValue !== undefined) {
|
||||||
|
return typeof additionalValue === 'number'
|
||||||
|
? additionalValue.toString()
|
||||||
|
: additionalValue;
|
||||||
|
}
|
||||||
|
if (clientHeader !== undefined) {
|
||||||
|
return clientHeader;
|
||||||
|
}
|
||||||
|
return _default;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Specialized version of _getExistingOrDefaultHeader for Content-Type header.
|
||||||
|
* Always returns a single string (not an array) since Content-Type should be a single value.
|
||||||
|
* Converts arrays to comma-separated strings and numbers to strings to ensure type safety.
|
||||||
|
* This was split from _getExistingOrDefaultHeader to provide stricter typing for callers
|
||||||
|
* that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]).
|
||||||
|
*/
|
||||||
|
_getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) {
|
||||||
|
let clientHeader;
|
||||||
|
if (this.requestOptions && this.requestOptions.headers) {
|
||||||
|
const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers.ContentType];
|
||||||
|
if (headerValue) {
|
||||||
|
if (typeof headerValue === 'number') {
|
||||||
|
clientHeader = String(headerValue);
|
||||||
|
}
|
||||||
|
else if (Array.isArray(headerValue)) {
|
||||||
|
clientHeader = headerValue.join(', ');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
clientHeader = headerValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const additionalValue = additionalHeaders[Headers.ContentType];
|
||||||
|
// Return the first non-undefined value, converting numbers or arrays to strings if necessary
|
||||||
|
if (additionalValue !== undefined) {
|
||||||
|
if (typeof additionalValue === 'number') {
|
||||||
|
return String(additionalValue);
|
||||||
|
}
|
||||||
|
else if (Array.isArray(additionalValue)) {
|
||||||
|
return additionalValue.join(', ');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return additionalValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (clientHeader !== undefined) {
|
||||||
|
return clientHeader;
|
||||||
|
}
|
||||||
|
return _default;
|
||||||
|
}
|
||||||
|
_getAgent(parsedUrl) {
|
||||||
|
let agent;
|
||||||
|
const proxyUrl = pm.getProxyUrl(parsedUrl);
|
||||||
|
const useProxy = proxyUrl && proxyUrl.hostname;
|
||||||
|
if (this._keepAlive && useProxy) {
|
||||||
|
agent = this._proxyAgent;
|
||||||
|
}
|
||||||
|
if (!useProxy) {
|
||||||
|
agent = this._agent;
|
||||||
|
}
|
||||||
|
// if agent is already assigned use that agent.
|
||||||
|
if (agent) {
|
||||||
|
return agent;
|
||||||
|
}
|
||||||
|
const usingSsl = parsedUrl.protocol === 'https:';
|
||||||
|
let maxSockets = 100;
|
||||||
|
if (this.requestOptions) {
|
||||||
|
maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
|
||||||
|
}
|
||||||
|
// This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
|
||||||
|
if (proxyUrl && proxyUrl.hostname) {
|
||||||
|
const agentOptions = {
|
||||||
|
maxSockets,
|
||||||
|
keepAlive: this._keepAlive,
|
||||||
|
proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
|
||||||
|
proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
|
||||||
|
})), { host: proxyUrl.hostname, port: proxyUrl.port })
|
||||||
|
};
|
||||||
|
let tunnelAgent;
|
||||||
|
const overHttps = proxyUrl.protocol === 'https:';
|
||||||
|
if (usingSsl) {
|
||||||
|
tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
|
||||||
|
}
|
||||||
|
agent = tunnelAgent(agentOptions);
|
||||||
|
this._proxyAgent = agent;
|
||||||
|
}
|
||||||
|
// if tunneling agent isn't assigned create a new agent
|
||||||
|
if (!agent) {
|
||||||
|
const options = { keepAlive: this._keepAlive, maxSockets };
|
||||||
|
agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
|
||||||
|
this._agent = agent;
|
||||||
|
}
|
||||||
|
if (usingSsl && this._ignoreSslError) {
|
||||||
|
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
|
||||||
|
// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
|
||||||
|
// we have to cast it to any and change it directly
|
||||||
|
agent.options = Object.assign(agent.options || {}, {
|
||||||
|
rejectUnauthorized: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return agent;
|
||||||
|
}
|
||||||
|
_getProxyAgentDispatcher(parsedUrl, proxyUrl) {
|
||||||
|
let proxyAgent;
|
||||||
|
if (this._keepAlive) {
|
||||||
|
proxyAgent = this._proxyAgentDispatcher;
|
||||||
|
}
|
||||||
|
// if agent is already assigned use that agent.
|
||||||
|
if (proxyAgent) {
|
||||||
|
return proxyAgent;
|
||||||
|
}
|
||||||
|
const usingSsl = parsedUrl.protocol === 'https:';
|
||||||
|
proxyAgent = new ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
|
||||||
|
token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}`
|
||||||
|
})));
|
||||||
|
this._proxyAgentDispatcher = proxyAgent;
|
||||||
|
if (usingSsl && this._ignoreSslError) {
|
||||||
|
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
|
||||||
|
// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
|
||||||
|
// we have to cast it to any and change it directly
|
||||||
|
proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
|
||||||
|
rejectUnauthorized: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return proxyAgent;
|
||||||
|
}
|
||||||
|
_getUserAgentWithOrchestrationId(userAgent) {
|
||||||
|
const baseUserAgent = userAgent || 'actions/http-client';
|
||||||
|
const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];
|
||||||
|
if (orchId) {
|
||||||
|
// Sanitize the orchestration ID to ensure it contains only valid characters
|
||||||
|
// Valid characters: 0-9, a-z, _, -, .
|
||||||
|
const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');
|
||||||
|
return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`;
|
||||||
|
}
|
||||||
|
return baseUserAgent;
|
||||||
|
}
|
||||||
|
_performExponentialBackoff(retryNumber) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
|
||||||
|
const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
|
||||||
|
return new Promise(resolve => setTimeout(() => resolve(), ms));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
_processResponse(res, options) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const statusCode = res.message.statusCode || 0;
|
||||||
|
const response = {
|
||||||
|
statusCode,
|
||||||
|
result: null,
|
||||||
|
headers: {}
|
||||||
|
};
|
||||||
|
// not found leads to null obj returned
|
||||||
|
if (statusCode === HttpCodes.NotFound) {
|
||||||
|
resolve(response);
|
||||||
|
}
|
||||||
|
// get the result from the body
|
||||||
|
function dateTimeDeserializer(key, value) {
|
||||||
|
if (typeof value === 'string') {
|
||||||
|
const a = new Date(value);
|
||||||
|
if (!isNaN(a.valueOf())) {
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
let obj;
|
||||||
|
let contents;
|
||||||
|
try {
|
||||||
|
contents = yield res.readBody();
|
||||||
|
if (contents && contents.length > 0) {
|
||||||
|
if (options && options.deserializeDates) {
|
||||||
|
obj = JSON.parse(contents, dateTimeDeserializer);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
obj = JSON.parse(contents);
|
||||||
|
}
|
||||||
|
response.result = obj;
|
||||||
|
}
|
||||||
|
response.headers = res.message.headers;
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
// Invalid resource (contents not json); leaving result obj null
|
||||||
|
}
|
||||||
|
// note that 3xx redirects are handled by the http layer.
|
||||||
|
if (statusCode > 299) {
|
||||||
|
let msg;
|
||||||
|
// if exception/error in body, attempt to get better error
|
||||||
|
if (obj && obj.message) {
|
||||||
|
msg = obj.message;
|
||||||
|
}
|
||||||
|
else if (contents && contents.length > 0) {
|
||||||
|
// it may be the case that the exception is in the body message as string
|
||||||
|
msg = contents;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
msg = `Failed request: (${statusCode})`;
|
||||||
|
}
|
||||||
|
const err = new HttpClientError(msg, statusCode);
|
||||||
|
err.result = response.result;
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(response);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
|
||||||
|
//# sourceMappingURL=index.js.map
|
||||||
1
node_modules/@actions/http-client/lib/index.js.map
generated
vendored
Normal file
1
node_modules/@actions/http-client/lib/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
43
node_modules/@actions/http-client/lib/interfaces.d.ts
generated
vendored
Normal file
43
node_modules/@actions/http-client/lib/interfaces.d.ts
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import * as http from 'http';
|
||||||
|
import * as https from 'https';
|
||||||
|
import { HttpClientResponse } from './index.js';
|
||||||
|
export interface HttpClient {
|
||||||
|
options(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
||||||
|
get(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
||||||
|
del(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
||||||
|
post(requestUrl: string, data: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
||||||
|
patch(requestUrl: string, data: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
||||||
|
put(requestUrl: string, data: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
||||||
|
sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
||||||
|
request(verb: string, requestUrl: string, data: string | NodeJS.ReadableStream, headers: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
||||||
|
requestRaw(info: RequestInfo, data: string | NodeJS.ReadableStream): Promise<HttpClientResponse>;
|
||||||
|
requestRawWithCallback(info: RequestInfo, data: string | NodeJS.ReadableStream, onResult: (err?: Error, res?: HttpClientResponse) => void): void;
|
||||||
|
}
|
||||||
|
export interface RequestHandler {
|
||||||
|
prepareRequest(options: http.RequestOptions): void;
|
||||||
|
canHandleAuthentication(response: HttpClientResponse): boolean;
|
||||||
|
handleAuthentication(httpClient: HttpClient, requestInfo: RequestInfo, data: string | NodeJS.ReadableStream | null): Promise<HttpClientResponse>;
|
||||||
|
}
|
||||||
|
export interface RequestInfo {
|
||||||
|
options: http.RequestOptions;
|
||||||
|
parsedUrl: URL;
|
||||||
|
httpModule: typeof http | typeof https;
|
||||||
|
}
|
||||||
|
export interface RequestOptions {
|
||||||
|
headers?: http.OutgoingHttpHeaders;
|
||||||
|
socketTimeout?: number;
|
||||||
|
ignoreSslError?: boolean;
|
||||||
|
allowRedirects?: boolean;
|
||||||
|
allowRedirectDowngrade?: boolean;
|
||||||
|
maxRedirects?: number;
|
||||||
|
maxSockets?: number;
|
||||||
|
keepAlive?: boolean;
|
||||||
|
deserializeDates?: boolean;
|
||||||
|
allowRetries?: boolean;
|
||||||
|
maxRetries?: number;
|
||||||
|
}
|
||||||
|
export interface TypedResponse<T> {
|
||||||
|
statusCode: number;
|
||||||
|
result: T | null;
|
||||||
|
headers: http.IncomingHttpHeaders;
|
||||||
|
}
|
||||||
2
node_modules/@actions/http-client/lib/interfaces.js
generated
vendored
Normal file
2
node_modules/@actions/http-client/lib/interfaces.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export {};
|
||||||
|
//# sourceMappingURL=interfaces.js.map
|
||||||
1
node_modules/@actions/http-client/lib/interfaces.js.map
generated
vendored
Normal file
1
node_modules/@actions/http-client/lib/interfaces.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":""}
|
||||||
2
node_modules/@actions/http-client/lib/proxy.d.ts
generated
vendored
Normal file
2
node_modules/@actions/http-client/lib/proxy.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export declare function getProxyUrl(reqUrl: URL): URL | undefined;
|
||||||
|
export declare function checkBypass(reqUrl: URL): boolean;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user