Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59db55461a | ||
|
|
4047224a50 | ||
|
|
c803c0b02d | ||
|
|
5fea8616de | ||
|
|
d830aca920 | ||
|
|
22298b02f4 | ||
|
|
bd41eaf093 | ||
|
|
814aedd45a | ||
|
|
8260ee063e | ||
|
|
800b0e5ae2 | ||
|
|
6c90dc8898 | ||
|
|
e1f6cb00bd | ||
|
|
6b96da32ae | ||
|
|
2bccdbc690 |
@@ -26,10 +26,10 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set Node.js 20.x
|
- name: Set Node.js 16.x
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 16.x
|
||||||
|
|
||||||
# Need root node_modules because certain npm packages like jest are configured for the entire repository and it won't be possible
|
# Need root node_modules because certain npm packages like jest are configured for the entire repository and it won't be possible
|
||||||
# without these to just compile the artifacts package
|
# without these to just compile the artifacts package
|
||||||
@@ -85,10 +85,10 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set Node.js 20.x
|
- name: Set Node.js 16.x
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 16.x
|
||||||
|
|
||||||
# Need root node_modules because certain npm packages like jest are configured for the entire repository and it won't be possible
|
# Need root node_modules because certain npm packages like jest are configured for the entire repository and it won't be possible
|
||||||
# without these to just compile the artifacts package
|
# without these to just compile the artifacts package
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set Node.js 20.x
|
- name: Set Node.js 16.x
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 16.x
|
||||||
|
|
||||||
- name: npm install
|
- name: npm install
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set Node.js 20.x
|
- name: Set Node.js 16.x
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 16.x
|
||||||
|
|
||||||
# In order to save & restore cache from a shell script, certain env variables need to be set that are only available in the
|
# In order to save & restore cache from a shell script, certain env variables need to be set that are only available in the
|
||||||
# node context. This runs a local action that gets and sets the necessary env variables that are needed
|
# node context. This runs a local action that gets and sets the necessary env variables that are needed
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
rm "C:\Program Files\Git\usr\bin\tar.exe"
|
rm "C:\Program Files\Git\usr\bin\tar.exe"
|
||||||
|
|
||||||
- name: Set Node.js 20.x
|
- name: Set Node.js 16.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 16.x
|
||||||
|
|
||||||
# In order to save & restore cache from a shell script, certain env variables need to be set that are only available in the
|
# In order to save & restore cache from a shell script, certain env variables need to be set that are only available in the
|
||||||
# node context. This runs a local action that gets and sets the necessary env variables that are needed
|
# node context. This runs a local action that gets and sets the necessary env variables that are needed
|
||||||
|
|||||||
@@ -24,14 +24,14 @@ jobs:
|
|||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@v1
|
||||||
with:
|
with:
|
||||||
languages: javascript
|
languages: javascript
|
||||||
|
|
||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@v2
|
uses: github/codeql-action/autobuild@v1
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v2
|
uses: github/codeql-action/analyze@v1
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ jobs:
|
|||||||
- name: verify package exists
|
- name: verify package exists
|
||||||
run: ls packages/${{ github.event.inputs.package }}
|
run: ls packages/${{ github.event.inputs.package }}
|
||||||
|
|
||||||
- name: Set Node.js 20.x
|
- name: Set Node.js 16.x
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 16.x
|
||||||
|
|
||||||
- name: npm install
|
- name: npm install
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set Node.js 20.x
|
- name: Set Node.js 16.x
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 16.x
|
||||||
|
|
||||||
- name: npm install
|
- name: npm install
|
||||||
run: npm install
|
run: npm install
|
||||||
@@ -40,7 +40,7 @@ jobs:
|
|||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: npm test
|
- name: npm test
|
||||||
run: npm test -- --runInBand --forceExit
|
run: npm test -- --runInBand
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
|
|||||||
Generated
+1400
-1193
File diff suppressed because it is too large
Load Diff
+5
-5
@@ -16,8 +16,8 @@
|
|||||||
"test": "jest --testTimeout 10000"
|
"test": "jest --testTimeout 10000"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^29.5.4",
|
"@types/jest": "^27.0.2",
|
||||||
"@types/node": "^20.5.7",
|
"@types/node": "^16.18.1",
|
||||||
"@types/signale": "^1.4.1",
|
"@types/signale": "^1.4.1",
|
||||||
"concurrently": "^6.1.0",
|
"concurrently": "^6.1.0",
|
||||||
"eslint": "^8.0.1",
|
"eslint": "^8.0.1",
|
||||||
@@ -26,11 +26,11 @@
|
|||||||
"eslint-plugin-jest": "^27.2.3",
|
"eslint-plugin-jest": "^27.2.3",
|
||||||
"eslint-plugin-prettier": "^5.0.0",
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"flow-bin": "^0.115.0",
|
"flow-bin": "^0.115.0",
|
||||||
"jest": "^29.6.4",
|
"jest": "^27.2.5",
|
||||||
"lerna": "^7.1.4",
|
"lerna": "^7.1.4",
|
||||||
"nx": "16.6.0",
|
"nx": "16.6.0",
|
||||||
"prettier": "^3.0.0",
|
"prettier": "^3.0.0",
|
||||||
"ts-jest": "^29.1.1",
|
"ts-jest": "^27.0.5",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^3.9.9"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,279 +0,0 @@
|
|||||||
import fs from 'fs'
|
|
||||||
import * as http from 'http'
|
|
||||||
import * as net from 'net'
|
|
||||||
import * as path from 'path'
|
|
||||||
import * as core from '@actions/core'
|
|
||||||
import * as github from '@actions/github'
|
|
||||||
import {HttpClient} from '@actions/http-client'
|
|
||||||
import type {RestEndpointMethods} from '@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types'
|
|
||||||
import archiver from 'archiver'
|
|
||||||
|
|
||||||
import {downloadArtifact} from '../src/internal/download/download-artifact'
|
|
||||||
import {getUserAgentString} from '../src/internal/shared/user-agent'
|
|
||||||
|
|
||||||
type MockedDownloadArtifact = jest.MockedFunction<
|
|
||||||
RestEndpointMethods['actions']['downloadArtifact']
|
|
||||||
>
|
|
||||||
|
|
||||||
const testDir = path.join(__dirname, '_temp', 'download-artifact')
|
|
||||||
const fixtures = {
|
|
||||||
workspaceDir: path.join(testDir, 'workspace'),
|
|
||||||
exampleArtifact: {
|
|
||||||
path: path.join(testDir, 'artifact.zip'),
|
|
||||||
files: [
|
|
||||||
{
|
|
||||||
path: 'hello.txt',
|
|
||||||
content: 'Hello World!'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'goodbye.txt',
|
|
||||||
content: 'Goodbye World!'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
artifactID: 1234,
|
|
||||||
repositoryOwner: 'actions',
|
|
||||||
repositoryName: 'toolkit',
|
|
||||||
token: 'ghp_1234567890',
|
|
||||||
blobStorageUrl: 'https://blob-storage.local?signed=true'
|
|
||||||
}
|
|
||||||
|
|
||||||
jest.mock('@actions/github', () => ({
|
|
||||||
getOctokit: jest.fn().mockReturnValue({
|
|
||||||
rest: {
|
|
||||||
actions: {
|
|
||||||
downloadArtifact: jest.fn()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}))
|
|
||||||
|
|
||||||
jest.mock('@actions/http-client')
|
|
||||||
|
|
||||||
// Create a zip archive with the contents of the example artifact
|
|
||||||
const createTestArchive = async (): Promise<void> => {
|
|
||||||
const archive = archiver('zip', {
|
|
||||||
zlib: {level: 9}
|
|
||||||
})
|
|
||||||
for (const file of fixtures.exampleArtifact.files) {
|
|
||||||
archive.append(file.content, {name: file.path})
|
|
||||||
}
|
|
||||||
archive.finalize()
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
archive.pipe(fs.createWriteStream(fixtures.exampleArtifact.path))
|
|
||||||
archive.on('error', reject)
|
|
||||||
archive.on('finish', resolve)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const expectExtractedArchive = async (dir: string): Promise<void> => {
|
|
||||||
for (const file of fixtures.exampleArtifact.files) {
|
|
||||||
const filePath = path.join(dir, file.path)
|
|
||||||
expect(fs.readFileSync(filePath, 'utf8')).toEqual(file.content)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
describe('download-artifact', () => {
|
|
||||||
beforeEach(async () => {
|
|
||||||
jest.spyOn(core, 'debug').mockImplementation(() => {})
|
|
||||||
jest.spyOn(core, 'info').mockImplementation(() => {})
|
|
||||||
jest.spyOn(core, 'warning').mockImplementation(() => {})
|
|
||||||
|
|
||||||
await fs.promises.mkdir(testDir, {recursive: true})
|
|
||||||
await createTestArchive()
|
|
||||||
|
|
||||||
process.env['GITHUB_WORKSPACE'] = fixtures.workspaceDir
|
|
||||||
})
|
|
||||||
|
|
||||||
afterEach(async () => {
|
|
||||||
jest.restoreAllMocks()
|
|
||||||
await fs.promises.rm(testDir, {recursive: true})
|
|
||||||
delete process.env['GITHUB_WORKSPACE']
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should successfully download an artifact to $GITHUB_WORKSPACE', async () => {
|
|
||||||
const downloadArtifactMock = github.getOctokit(fixtures.token).rest.actions
|
|
||||||
.downloadArtifact as MockedDownloadArtifact
|
|
||||||
downloadArtifactMock.mockResolvedValueOnce({
|
|
||||||
headers: {
|
|
||||||
location: fixtures.blobStorageUrl
|
|
||||||
},
|
|
||||||
status: 302,
|
|
||||||
url: '',
|
|
||||||
data: Buffer.from('')
|
|
||||||
})
|
|
||||||
|
|
||||||
const getMock = jest.fn(() => {
|
|
||||||
const message = new http.IncomingMessage(new net.Socket())
|
|
||||||
message.statusCode = 200
|
|
||||||
message.push(fs.readFileSync(fixtures.exampleArtifact.path))
|
|
||||||
return {
|
|
||||||
message
|
|
||||||
}
|
|
||||||
})
|
|
||||||
const httpClientMock = (HttpClient as jest.Mock).mockImplementation(() => {
|
|
||||||
return {
|
|
||||||
get: getMock
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const response = await downloadArtifact(
|
|
||||||
fixtures.artifactID,
|
|
||||||
fixtures.repositoryOwner,
|
|
||||||
fixtures.repositoryName,
|
|
||||||
fixtures.token
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(downloadArtifactMock).toHaveBeenCalledWith({
|
|
||||||
owner: fixtures.repositoryOwner,
|
|
||||||
repo: fixtures.repositoryName,
|
|
||||||
artifact_id: fixtures.artifactID,
|
|
||||||
archive_format: 'zip',
|
|
||||||
request: {
|
|
||||||
redirect: 'manual'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
expect(httpClientMock).toHaveBeenCalledWith(getUserAgentString())
|
|
||||||
expect(getMock).toHaveBeenCalledWith(fixtures.blobStorageUrl)
|
|
||||||
|
|
||||||
expectExtractedArchive(fixtures.workspaceDir)
|
|
||||||
|
|
||||||
expect(response.success).toBe(true)
|
|
||||||
expect(response.downloadPath).toBe(fixtures.workspaceDir)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should successfully download an artifact to user defined path', async () => {
|
|
||||||
const customPath = path.join(testDir, 'custom')
|
|
||||||
|
|
||||||
const downloadArtifactMock = github.getOctokit(fixtures.token).rest.actions
|
|
||||||
.downloadArtifact as MockedDownloadArtifact
|
|
||||||
downloadArtifactMock.mockResolvedValueOnce({
|
|
||||||
headers: {
|
|
||||||
location: fixtures.blobStorageUrl
|
|
||||||
},
|
|
||||||
status: 302,
|
|
||||||
url: '',
|
|
||||||
data: Buffer.from('')
|
|
||||||
})
|
|
||||||
|
|
||||||
const getMock = jest.fn(() => {
|
|
||||||
const message = new http.IncomingMessage(new net.Socket())
|
|
||||||
message.statusCode = 200
|
|
||||||
message.push(fs.readFileSync(fixtures.exampleArtifact.path))
|
|
||||||
return {
|
|
||||||
message
|
|
||||||
}
|
|
||||||
})
|
|
||||||
const httpClientMock = (HttpClient as jest.Mock).mockImplementation(() => {
|
|
||||||
return {
|
|
||||||
get: getMock
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const response = await downloadArtifact(
|
|
||||||
fixtures.artifactID,
|
|
||||||
fixtures.repositoryOwner,
|
|
||||||
fixtures.repositoryName,
|
|
||||||
fixtures.token,
|
|
||||||
{
|
|
||||||
path: customPath
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(downloadArtifactMock).toHaveBeenCalledWith({
|
|
||||||
owner: fixtures.repositoryOwner,
|
|
||||||
repo: fixtures.repositoryName,
|
|
||||||
artifact_id: fixtures.artifactID,
|
|
||||||
archive_format: 'zip',
|
|
||||||
request: {
|
|
||||||
redirect: 'manual'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
expect(httpClientMock).toHaveBeenCalledWith(getUserAgentString())
|
|
||||||
expect(getMock).toHaveBeenCalledWith(fixtures.blobStorageUrl)
|
|
||||||
|
|
||||||
expectExtractedArchive(customPath)
|
|
||||||
|
|
||||||
expect(response.success).toBe(true)
|
|
||||||
expect(response.downloadPath).toBe(customPath)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should fail if download artifact API does not respond with location', async () => {
|
|
||||||
const downloadArtifactMock = github.getOctokit(fixtures.token).rest.actions
|
|
||||||
.downloadArtifact as MockedDownloadArtifact
|
|
||||||
downloadArtifactMock.mockResolvedValueOnce({
|
|
||||||
headers: {},
|
|
||||||
status: 302,
|
|
||||||
url: '',
|
|
||||||
data: Buffer.from('')
|
|
||||||
})
|
|
||||||
|
|
||||||
await expect(
|
|
||||||
downloadArtifact(
|
|
||||||
fixtures.artifactID,
|
|
||||||
fixtures.repositoryOwner,
|
|
||||||
fixtures.repositoryName,
|
|
||||||
fixtures.token
|
|
||||||
)
|
|
||||||
).rejects.toBeInstanceOf(Error)
|
|
||||||
|
|
||||||
expect(downloadArtifactMock).toHaveBeenCalledWith({
|
|
||||||
owner: fixtures.repositoryOwner,
|
|
||||||
repo: fixtures.repositoryName,
|
|
||||||
artifact_id: fixtures.artifactID,
|
|
||||||
archive_format: 'zip',
|
|
||||||
request: {
|
|
||||||
redirect: 'manual'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should fail if blob storage response is non-200', async () => {
|
|
||||||
const downloadArtifactMock = github.getOctokit(fixtures.token).rest.actions
|
|
||||||
.downloadArtifact as MockedDownloadArtifact
|
|
||||||
downloadArtifactMock.mockResolvedValueOnce({
|
|
||||||
headers: {
|
|
||||||
location: fixtures.blobStorageUrl
|
|
||||||
},
|
|
||||||
status: 302,
|
|
||||||
url: '',
|
|
||||||
data: Buffer.from('')
|
|
||||||
})
|
|
||||||
|
|
||||||
const getMock = jest.fn(() => {
|
|
||||||
const message = new http.IncomingMessage(new net.Socket())
|
|
||||||
message.statusCode = 500
|
|
||||||
message.push('Internal Server Error')
|
|
||||||
return {
|
|
||||||
message
|
|
||||||
}
|
|
||||||
})
|
|
||||||
const httpClientMock = (HttpClient as jest.Mock).mockImplementation(() => {
|
|
||||||
return {
|
|
||||||
get: getMock
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
await expect(
|
|
||||||
downloadArtifact(
|
|
||||||
fixtures.artifactID,
|
|
||||||
fixtures.repositoryOwner,
|
|
||||||
fixtures.repositoryName,
|
|
||||||
fixtures.token
|
|
||||||
)
|
|
||||||
).rejects.toBeInstanceOf(Error)
|
|
||||||
|
|
||||||
expect(downloadArtifactMock).toHaveBeenCalledWith({
|
|
||||||
owner: fixtures.repositoryOwner,
|
|
||||||
repo: fixtures.repositoryName,
|
|
||||||
artifact_id: fixtures.artifactID,
|
|
||||||
archive_format: 'zip',
|
|
||||||
request: {
|
|
||||||
redirect: 'manual'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
expect(httpClientMock).toHaveBeenCalledWith(getUserAgentString())
|
|
||||||
expect(getMock).toHaveBeenCalledWith(fixtures.blobStorageUrl)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
@@ -1,362 +0,0 @@
|
|||||||
import * as core from '@actions/core'
|
|
||||||
import * as uploadZipSpecification from '../src/internal/upload/upload-zip-specification'
|
|
||||||
import * as zip from '../src/internal/upload/zip'
|
|
||||||
import * as util from '../src/internal/shared/util'
|
|
||||||
import * as retention from '../src/internal/upload/retention'
|
|
||||||
import * as config from '../src/internal/shared/config'
|
|
||||||
import {Timestamp, ArtifactServiceClientJSON} from '../src/generated'
|
|
||||||
import * as blobUpload from '../src/internal/upload/blob-upload'
|
|
||||||
import {uploadArtifact} from '../src/internal/upload/upload-artifact'
|
|
||||||
|
|
||||||
describe('upload-artifact', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
// mock all output so that there is less noise when running tests
|
|
||||||
jest.spyOn(console, 'log').mockImplementation(() => {})
|
|
||||||
jest.spyOn(core, 'debug').mockImplementation(() => {})
|
|
||||||
jest.spyOn(core, 'info').mockImplementation(() => {})
|
|
||||||
jest.spyOn(core, 'warning').mockImplementation(() => {})
|
|
||||||
})
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
jest.restoreAllMocks()
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should successfully upload an artifact', () => {
|
|
||||||
const mockDate = new Date('2020-01-01')
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
|
||||||
.mockReturnValue([
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file1.txt',
|
|
||||||
destinationPath: 'file1.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file2.txt',
|
|
||||||
destinationPath: 'file2.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/dir/file3.txt',
|
|
||||||
destinationPath: 'dir/file3.txt'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
jest
|
|
||||||
.spyOn(zip, 'createZipUploadStream')
|
|
||||||
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
|
||||||
jest.spyOn(util, 'getBackendIdsFromToken').mockReturnValue({
|
|
||||||
workflowRunBackendId: '1234',
|
|
||||||
workflowJobRunBackendId: '5678'
|
|
||||||
})
|
|
||||||
jest
|
|
||||||
.spyOn(retention, 'getExpiration')
|
|
||||||
.mockReturnValue(Timestamp.fromDate(mockDate))
|
|
||||||
jest
|
|
||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
|
||||||
.mockReturnValue(
|
|
||||||
Promise.resolve({
|
|
||||||
ok: true,
|
|
||||||
signedUploadUrl: 'https://signed-upload-url.com'
|
|
||||||
})
|
|
||||||
)
|
|
||||||
jest.spyOn(blobUpload, 'uploadZipToBlobStorage').mockReturnValue(
|
|
||||||
Promise.resolve({
|
|
||||||
isSuccess: true,
|
|
||||||
uploadSize: 1234,
|
|
||||||
md5Hash: 'test-md5-hash'
|
|
||||||
})
|
|
||||||
)
|
|
||||||
jest
|
|
||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'FinalizeArtifact')
|
|
||||||
.mockReturnValue(Promise.resolve({ok: true, artifactId: '1'}))
|
|
||||||
|
|
||||||
// ArtifactHttpClient mocks
|
|
||||||
jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token')
|
|
||||||
jest
|
|
||||||
.spyOn(config, 'getResultsServiceUrl')
|
|
||||||
.mockReturnValue('https://test-url.com')
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
|
||||||
'test-artifact',
|
|
||||||
[
|
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(uploadResp).resolves.toEqual({success: true, size: 1234, id: 1})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should throw an error if the root directory is invalid', () => {
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockImplementation(() => {
|
|
||||||
throw new Error('Invalid root directory')
|
|
||||||
})
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
|
||||||
'test-artifact',
|
|
||||||
[
|
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(uploadResp).rejects.toThrow('Invalid root directory')
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should return false if there are no files to upload', () => {
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
|
||||||
.mockReturnValue([])
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
|
||||||
'test-artifact',
|
|
||||||
[
|
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
|
||||||
expect(uploadResp).resolves.toEqual({success: false})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should return false if no backend IDs are found', () => {
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
|
||||||
.mockReturnValue([
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file1.txt',
|
|
||||||
destinationPath: 'file1.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file2.txt',
|
|
||||||
destinationPath: 'file2.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/dir/file3.txt',
|
|
||||||
destinationPath: 'dir/file3.txt'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
jest
|
|
||||||
.spyOn(zip, 'createZipUploadStream')
|
|
||||||
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
|
||||||
jest
|
|
||||||
.spyOn(util, 'getBackendIdsFromToken')
|
|
||||||
.mockReturnValue({workflowRunBackendId: '', workflowJobRunBackendId: ''})
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
|
||||||
'test-artifact',
|
|
||||||
[
|
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(uploadResp).resolves.toEqual({success: false})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should return false if the creation request fails', () => {
|
|
||||||
const mockDate = new Date('2020-01-01')
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
|
||||||
.mockReturnValue([
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file1.txt',
|
|
||||||
destinationPath: 'file1.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file2.txt',
|
|
||||||
destinationPath: 'file2.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/dir/file3.txt',
|
|
||||||
destinationPath: 'dir/file3.txt'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
jest
|
|
||||||
.spyOn(zip, 'createZipUploadStream')
|
|
||||||
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
|
||||||
jest.spyOn(util, 'getBackendIdsFromToken').mockReturnValue({
|
|
||||||
workflowRunBackendId: '1234',
|
|
||||||
workflowJobRunBackendId: '5678'
|
|
||||||
})
|
|
||||||
jest
|
|
||||||
.spyOn(retention, 'getExpiration')
|
|
||||||
.mockReturnValue(Timestamp.fromDate(mockDate))
|
|
||||||
jest
|
|
||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
|
||||||
.mockReturnValue(Promise.resolve({ok: false, signedUploadUrl: ''}))
|
|
||||||
|
|
||||||
// ArtifactHttpClient mocks
|
|
||||||
jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token')
|
|
||||||
jest
|
|
||||||
.spyOn(config, 'getResultsServiceUrl')
|
|
||||||
.mockReturnValue('https://test-url.com')
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
|
||||||
'test-artifact',
|
|
||||||
[
|
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(uploadResp).resolves.toEqual({success: false})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should return false if blob storage upload is unsuccessful', () => {
|
|
||||||
const mockDate = new Date('2020-01-01')
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
|
||||||
.mockReturnValue([
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file1.txt',
|
|
||||||
destinationPath: 'file1.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file2.txt',
|
|
||||||
destinationPath: 'file2.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/dir/file3.txt',
|
|
||||||
destinationPath: 'dir/file3.txt'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
jest
|
|
||||||
.spyOn(zip, 'createZipUploadStream')
|
|
||||||
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
|
||||||
jest.spyOn(util, 'getBackendIdsFromToken').mockReturnValue({
|
|
||||||
workflowRunBackendId: '1234',
|
|
||||||
workflowJobRunBackendId: '5678'
|
|
||||||
})
|
|
||||||
jest
|
|
||||||
.spyOn(retention, 'getExpiration')
|
|
||||||
.mockReturnValue(Timestamp.fromDate(mockDate))
|
|
||||||
jest
|
|
||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
|
||||||
.mockReturnValue(
|
|
||||||
Promise.resolve({
|
|
||||||
ok: true,
|
|
||||||
signedUploadUrl: 'https://signed-upload-url.com'
|
|
||||||
})
|
|
||||||
)
|
|
||||||
jest
|
|
||||||
.spyOn(blobUpload, 'uploadZipToBlobStorage')
|
|
||||||
.mockReturnValue(Promise.resolve({isSuccess: false}))
|
|
||||||
|
|
||||||
// ArtifactHttpClient mocks
|
|
||||||
jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token')
|
|
||||||
jest
|
|
||||||
.spyOn(config, 'getResultsServiceUrl')
|
|
||||||
.mockReturnValue('https://test-url.com')
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
|
||||||
'test-artifact',
|
|
||||||
[
|
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(uploadResp).resolves.toEqual({success: false})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should return false if finalize artifact fails', () => {
|
|
||||||
const mockDate = new Date('2020-01-01')
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
|
||||||
.mockReturnValue([
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file1.txt',
|
|
||||||
destinationPath: 'file1.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file2.txt',
|
|
||||||
destinationPath: 'file2.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/dir/file3.txt',
|
|
||||||
destinationPath: 'dir/file3.txt'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
jest
|
|
||||||
.spyOn(zip, 'createZipUploadStream')
|
|
||||||
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
|
||||||
jest.spyOn(util, 'getBackendIdsFromToken').mockReturnValue({
|
|
||||||
workflowRunBackendId: '1234',
|
|
||||||
workflowJobRunBackendId: '5678'
|
|
||||||
})
|
|
||||||
jest
|
|
||||||
.spyOn(retention, 'getExpiration')
|
|
||||||
.mockReturnValue(Timestamp.fromDate(mockDate))
|
|
||||||
jest
|
|
||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
|
||||||
.mockReturnValue(
|
|
||||||
Promise.resolve({
|
|
||||||
ok: true,
|
|
||||||
signedUploadUrl: 'https://signed-upload-url.com'
|
|
||||||
})
|
|
||||||
)
|
|
||||||
jest.spyOn(blobUpload, 'uploadZipToBlobStorage').mockReturnValue(
|
|
||||||
Promise.resolve({
|
|
||||||
isSuccess: true,
|
|
||||||
uploadSize: 1234,
|
|
||||||
md5Hash: 'test-md5-hash'
|
|
||||||
})
|
|
||||||
)
|
|
||||||
jest
|
|
||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'FinalizeArtifact')
|
|
||||||
.mockReturnValue(Promise.resolve({ok: false, artifactId: ''}))
|
|
||||||
|
|
||||||
// ArtifactHttpClient mocks
|
|
||||||
jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token')
|
|
||||||
jest
|
|
||||||
.spyOn(config, 'getResultsServiceUrl')
|
|
||||||
.mockReturnValue('https://test-url.com')
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
|
||||||
'test-artifact',
|
|
||||||
[
|
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(uploadResp).resolves.toEqual({success: false})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
Generated
+6
-236
@@ -16,18 +16,15 @@
|
|||||||
"@octokit/core": "^3.5.1",
|
"@octokit/core": "^3.5.1",
|
||||||
"@octokit/plugin-request-log": "^1.0.4",
|
"@octokit/plugin-request-log": "^1.0.4",
|
||||||
"@octokit/plugin-retry": "^3.0.9",
|
"@octokit/plugin-retry": "^3.0.9",
|
||||||
"@octokit/request-error": "^5.0.0",
|
|
||||||
"@protobuf-ts/plugin": "^2.2.3-alpha.1",
|
"@protobuf-ts/plugin": "^2.2.3-alpha.1",
|
||||||
"@types/unzipper": "^0.10.6",
|
|
||||||
"archiver": "^5.3.1",
|
"archiver": "^5.3.1",
|
||||||
"crypto": "^1.0.1",
|
"crypto": "^1.0.1",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"twirp-ts": "^2.5.0",
|
"twirp-ts": "^2.5.0"
|
||||||
"unzipper": "^0.10.14"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/archiver": "^5.3.2",
|
"@types/archiver": "^5.3.2",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^4.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
@@ -294,32 +291,6 @@
|
|||||||
"universal-user-agent": "^6.0.0"
|
"universal-user-agent": "^6.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@octokit/request-error": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-1ue0DH0Lif5iEqT52+Rf/hf0RmGO9NWFjrzmrkArpG9trFfDM/efx00BJHdLGuro4BR/gECxCU2Twf5OKrRFsQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"@octokit/types": "^11.0.0",
|
|
||||||
"deprecation": "^2.0.0",
|
|
||||||
"once": "^1.4.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 18"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@octokit/request-error/node_modules/@octokit/openapi-types": {
|
|
||||||
"version": "18.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.0.0.tgz",
|
|
||||||
"integrity": "sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw=="
|
|
||||||
},
|
|
||||||
"node_modules/@octokit/request-error/node_modules/@octokit/types": {
|
|
||||||
"version": "11.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-11.1.0.tgz",
|
|
||||||
"integrity": "sha512-Fz0+7GyLm/bHt8fwEqgvRBWwIV1S6wRRyq+V6exRKLVWaKGsuy6H9QFYeBVDV7rK6fO3XwHgQOPxv+cLj2zpXQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"@octokit/openapi-types": "^18.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@octokit/request/node_modules/@octokit/request-error": {
|
"node_modules/@octokit/request/node_modules/@octokit/request-error": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz",
|
||||||
@@ -469,14 +440,6 @@
|
|||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/unzipper": {
|
|
||||||
"version": "0.10.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/unzipper/-/unzipper-0.10.6.tgz",
|
|
||||||
"integrity": "sha512-zcBj329AHgKLQyz209N/S9R0GZqXSkUQO4tJSYE3x02qg4JuDFpgKMj50r82Erk1natCWQDIvSccDddt7jPzjA==",
|
|
||||||
"dependencies": {
|
|
||||||
"@types/node": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/archiver": {
|
"node_modules/archiver": {
|
||||||
"version": "5.3.1",
|
"version": "5.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/archiver/-/archiver-5.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/archiver/-/archiver-5.3.1.tgz",
|
||||||
@@ -580,26 +543,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz",
|
||||||
"integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ=="
|
"integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ=="
|
||||||
},
|
},
|
||||||
"node_modules/big-integer": {
|
|
||||||
"version": "1.6.51",
|
|
||||||
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz",
|
|
||||||
"integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/binary": {
|
|
||||||
"version": "0.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz",
|
|
||||||
"integrity": "sha512-D4H1y5KYwpJgK8wk1Cue5LLPgmwHKYSChkbspQg5JtVuR5ulGckxfR62H3AE9UDkdMC8yyXlqYihuz3Aqg2XZg==",
|
|
||||||
"dependencies": {
|
|
||||||
"buffers": "~0.1.1",
|
|
||||||
"chainsaw": "~0.1.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/bl": {
|
"node_modules/bl": {
|
||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
|
||||||
@@ -610,11 +553,6 @@
|
|||||||
"readable-stream": "^3.4.0"
|
"readable-stream": "^3.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/bluebird": {
|
|
||||||
"version": "3.4.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz",
|
|
||||||
"integrity": "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA=="
|
|
||||||
},
|
|
||||||
"node_modules/bottleneck": {
|
"node_modules/bottleneck": {
|
||||||
"version": "2.19.5",
|
"version": "2.19.5",
|
||||||
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
|
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
|
||||||
@@ -660,22 +598,6 @@
|
|||||||
"node": "*"
|
"node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/buffer-indexof-polyfill": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-I7wzHwA3t1/lwXQh+A5PbNvJxgfo5r3xulgpYDB5zckTu/Z9oUK9biouBKQUjEqzaz3HnAT6TYoovmE+GqSf7A==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/buffers": {
|
|
||||||
"version": "0.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz",
|
|
||||||
"integrity": "sha512-9q/rDEGSb/Qsvv2qvzIzdluL5k7AaJOTrw23z9reQthrbF7is4CtlT0DXyO1oei2DCp4uojjzQ7igaSHp1kAEQ==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.2.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/camel-case": {
|
"node_modules/camel-case": {
|
||||||
"version": "4.1.2",
|
"version": "4.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz",
|
||||||
@@ -685,17 +607,6 @@
|
|||||||
"tslib": "^2.0.3"
|
"tslib": "^2.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/chainsaw": {
|
|
||||||
"version": "0.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz",
|
|
||||||
"integrity": "sha512-75kWfWt6MEKNC8xYXIdRpDehRYY/tNSgwKaJq+dbbDcxORuVrrQ+SEHoWsniVn9XPYfP4gmdWIeDk/4YNp1rNQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"traverse": ">=0.3.0 <0.4"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/combined-stream": {
|
"node_modules/combined-stream": {
|
||||||
"version": "1.0.8",
|
"version": "1.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
@@ -793,41 +704,6 @@
|
|||||||
"dot-object": "bin/dot-object"
|
"dot-object": "bin/dot-object"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/duplexer2": {
|
|
||||||
"version": "0.1.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz",
|
|
||||||
"integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==",
|
|
||||||
"dependencies": {
|
|
||||||
"readable-stream": "^2.0.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/duplexer2/node_modules/readable-stream": {
|
|
||||||
"version": "2.3.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
|
|
||||||
"integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
|
|
||||||
"dependencies": {
|
|
||||||
"core-util-is": "~1.0.0",
|
|
||||||
"inherits": "~2.0.3",
|
|
||||||
"isarray": "~1.0.0",
|
|
||||||
"process-nextick-args": "~2.0.0",
|
|
||||||
"safe-buffer": "~5.1.1",
|
|
||||||
"string_decoder": "~1.1.1",
|
|
||||||
"util-deprecate": "~1.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/duplexer2/node_modules/safe-buffer": {
|
|
||||||
"version": "5.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
|
||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
|
||||||
},
|
|
||||||
"node_modules/duplexer2/node_modules/string_decoder": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
|
||||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
|
||||||
"dependencies": {
|
|
||||||
"safe-buffer": "~5.1.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/end-of-stream": {
|
"node_modules/end-of-stream": {
|
||||||
"version": "1.4.4",
|
"version": "1.4.4",
|
||||||
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
|
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
|
||||||
@@ -867,20 +743,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||||
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
|
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
|
||||||
},
|
},
|
||||||
"node_modules/fstream": {
|
|
||||||
"version": "1.0.12",
|
|
||||||
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz",
|
|
||||||
"integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==",
|
|
||||||
"dependencies": {
|
|
||||||
"graceful-fs": "^4.1.2",
|
|
||||||
"inherits": "~2.0.0",
|
|
||||||
"mkdirp": ">=0.5 0",
|
|
||||||
"rimraf": "2"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/glob": {
|
"node_modules/glob": {
|
||||||
"version": "7.2.3",
|
"version": "7.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
||||||
@@ -994,11 +856,6 @@
|
|||||||
"safe-buffer": "~5.1.0"
|
"safe-buffer": "~5.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/listenercount": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/listenercount/-/listenercount-1.0.1.tgz",
|
|
||||||
"integrity": "sha512-3mk/Zag0+IJxeDrxSgaDPy4zZ3w05PRZeJNnlWhzFz5OkX49J4krc+A8X2d2M69vGMBEX0uyl8M+W+8gH+kBqQ=="
|
|
||||||
},
|
|
||||||
"node_modules/lodash": {
|
"node_modules/lodash": {
|
||||||
"version": "4.17.21",
|
"version": "4.17.21",
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||||
@@ -1067,25 +924,6 @@
|
|||||||
"node": "*"
|
"node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/minimist": {
|
|
||||||
"version": "1.2.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
|
||||||
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/ljharb"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/mkdirp": {
|
|
||||||
"version": "0.5.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
|
|
||||||
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
|
|
||||||
"dependencies": {
|
|
||||||
"minimist": "^1.2.6"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"mkdirp": "bin/cmd.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/no-case": {
|
"node_modules/no-case": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz",
|
||||||
@@ -1219,17 +1057,6 @@
|
|||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/rimraf": {
|
|
||||||
"version": "2.7.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
|
||||||
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
|
|
||||||
"dependencies": {
|
|
||||||
"glob": "^7.1.3"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"rimraf": "bin.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/safe-buffer": {
|
"node_modules/safe-buffer": {
|
||||||
"version": "5.2.1",
|
"version": "5.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||||
@@ -1254,11 +1081,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
||||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
||||||
},
|
},
|
||||||
"node_modules/setimmediate": {
|
|
||||||
"version": "1.0.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
|
|
||||||
"integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA=="
|
|
||||||
},
|
|
||||||
"node_modules/string_decoder": {
|
"node_modules/string_decoder": {
|
||||||
"version": "1.3.0",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||||
@@ -1287,14 +1109,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
||||||
},
|
},
|
||||||
"node_modules/traverse": {
|
|
||||||
"version": "0.3.9",
|
|
||||||
"resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz",
|
|
||||||
"integrity": "sha512-iawgk0hLP3SxGKDfnDJf8wTz4p2qImnyihM5Hh/sGvQ3K37dPi/w8sRhdNIxYA1TwFwc5mDhIJq+O0RsvXBKdQ==",
|
|
||||||
"engines": {
|
|
||||||
"node": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/ts-poet": {
|
"node_modules/ts-poet": {
|
||||||
"version": "4.15.0",
|
"version": "4.15.0",
|
||||||
"resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-4.15.0.tgz",
|
"resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-4.15.0.tgz",
|
||||||
@@ -1346,16 +1160,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "5.2.2",
|
"version": "4.9.5",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
||||||
"integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
|
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.17"
|
"node": ">=4.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/universal-user-agent": {
|
"node_modules/universal-user-agent": {
|
||||||
@@ -1363,50 +1177,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
|
||||||
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
|
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
|
||||||
},
|
},
|
||||||
"node_modules/unzipper": {
|
|
||||||
"version": "0.10.14",
|
|
||||||
"resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.10.14.tgz",
|
|
||||||
"integrity": "sha512-ti4wZj+0bQTiX2KmKWuwj7lhV+2n//uXEotUmGuQqrbVZSEGFMbI68+c6JCQ8aAmUWYvtHEz2A8K6wXvueR/6g==",
|
|
||||||
"dependencies": {
|
|
||||||
"big-integer": "^1.6.17",
|
|
||||||
"binary": "~0.3.0",
|
|
||||||
"bluebird": "~3.4.1",
|
|
||||||
"buffer-indexof-polyfill": "~1.0.0",
|
|
||||||
"duplexer2": "~0.1.4",
|
|
||||||
"fstream": "^1.0.12",
|
|
||||||
"graceful-fs": "^4.2.2",
|
|
||||||
"listenercount": "~1.0.1",
|
|
||||||
"readable-stream": "~2.3.6",
|
|
||||||
"setimmediate": "~1.0.4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/unzipper/node_modules/readable-stream": {
|
|
||||||
"version": "2.3.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
|
|
||||||
"integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
|
|
||||||
"dependencies": {
|
|
||||||
"core-util-is": "~1.0.0",
|
|
||||||
"inherits": "~2.0.3",
|
|
||||||
"isarray": "~1.0.0",
|
|
||||||
"process-nextick-args": "~2.0.0",
|
|
||||||
"safe-buffer": "~5.1.1",
|
|
||||||
"string_decoder": "~1.1.1",
|
|
||||||
"util-deprecate": "~1.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/unzipper/node_modules/safe-buffer": {
|
|
||||||
"version": "5.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
|
||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
|
||||||
},
|
|
||||||
"node_modules/unzipper/node_modules/string_decoder": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
|
||||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
|
||||||
"dependencies": {
|
|
||||||
"safe-buffer": "~5.1.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/util-deprecate": {
|
"node_modules/util-deprecate": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||||
|
|||||||
@@ -46,17 +46,14 @@
|
|||||||
"@octokit/core": "^3.5.1",
|
"@octokit/core": "^3.5.1",
|
||||||
"@octokit/plugin-request-log": "^1.0.4",
|
"@octokit/plugin-request-log": "^1.0.4",
|
||||||
"@octokit/plugin-retry": "^3.0.9",
|
"@octokit/plugin-retry": "^3.0.9",
|
||||||
"@octokit/request-error": "^5.0.0",
|
|
||||||
"@protobuf-ts/plugin": "^2.2.3-alpha.1",
|
"@protobuf-ts/plugin": "^2.2.3-alpha.1",
|
||||||
"@types/unzipper": "^0.10.6",
|
|
||||||
"archiver": "^5.3.1",
|
"archiver": "^5.3.1",
|
||||||
"crypto": "^1.0.1",
|
"crypto": "^1.0.1",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"twirp-ts": "^2.5.0",
|
"twirp-ts": "^2.5.0"
|
||||||
"unzipper": "^0.10.14"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/archiver": "^5.3.2",
|
"@types/archiver": "^5.3.2",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^4.3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ export {ArtifactClient}
|
|||||||
|
|
||||||
export function create(): ArtifactClient {
|
export function create(): ArtifactClient {
|
||||||
return Client.create()
|
return Client.create()
|
||||||
}
|
}
|
||||||
@@ -1,46 +1,13 @@
|
|||||||
import fs from 'fs/promises'
|
|
||||||
import * as github from '@actions/github'
|
import * as github from '@actions/github'
|
||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import * as httpClient from '@actions/http-client'
|
import * as httpClient from '@actions/http-client'
|
||||||
import unzipper from 'unzipper'
|
|
||||||
import {
|
import {
|
||||||
DownloadArtifactOptions,
|
DownloadArtifactOptions,
|
||||||
DownloadArtifactResponse
|
DownloadArtifactResponse
|
||||||
} from '../shared/interfaces'
|
} from '../shared/interfaces'
|
||||||
import {getUserAgentString} from '../shared/user-agent'
|
// import { getUserAgentString } from '../shared/user-agent'
|
||||||
import {getGitHubWorkspaceDir} from '../shared/config'
|
// import * as unzipper from 'unzipper'
|
||||||
|
|
||||||
const scrubQueryParameters = (url: string): string => {
|
|
||||||
const parsed = new URL(url)
|
|
||||||
parsed.search = ''
|
|
||||||
return parsed.toString()
|
|
||||||
}
|
|
||||||
|
|
||||||
async function exists(path: string): Promise<boolean> {
|
|
||||||
try {
|
|
||||||
await fs.access(path)
|
|
||||||
return true
|
|
||||||
} catch (error) {
|
|
||||||
if (error.code === 'ENOENT') {
|
|
||||||
return false
|
|
||||||
} else {
|
|
||||||
throw error
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function streamExtract(url: string, directory: string): Promise<void> {
|
|
||||||
const client = new httpClient.HttpClient(getUserAgentString())
|
|
||||||
const response = await client.get(url)
|
|
||||||
|
|
||||||
if (response.message.statusCode !== 200) {
|
|
||||||
throw new Error(
|
|
||||||
`Unexpected HTTP response from blob storage: ${response.message.statusCode} ${response.message.statusMessage}`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return response.message.pipe(unzipper.Extract({path: directory})).promise()
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function downloadArtifact(
|
export async function downloadArtifact(
|
||||||
artifactId: number,
|
artifactId: number,
|
||||||
@@ -49,22 +16,9 @@ export async function downloadArtifact(
|
|||||||
token: string,
|
token: string,
|
||||||
options?: DownloadArtifactOptions
|
options?: DownloadArtifactOptions
|
||||||
): Promise<DownloadArtifactResponse> {
|
): Promise<DownloadArtifactResponse> {
|
||||||
const downloadPath = options?.path || getGitHubWorkspaceDir()
|
|
||||||
|
|
||||||
if (!(await exists(downloadPath))) {
|
|
||||||
core.debug(
|
|
||||||
`Artifact destination folder does not exist, creating: ${downloadPath}`
|
|
||||||
)
|
|
||||||
await fs.mkdir(downloadPath, {recursive: true})
|
|
||||||
} else {
|
|
||||||
core.debug(`Artifact destination folder already exists: ${downloadPath}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
const api = github.getOctokit(token)
|
const api = github.getOctokit(token)
|
||||||
|
|
||||||
core.info(
|
core.info(`Downloading artifact ${artifactId} from ${repositoryOwner}/${repositoryName}`)
|
||||||
`Downloading artifact '${artifactId}' from '${repositoryOwner}/${repositoryName}'`
|
|
||||||
)
|
|
||||||
|
|
||||||
const {headers, status} = await api.rest.actions.downloadArtifact({
|
const {headers, status} = await api.rest.actions.downloadArtifact({
|
||||||
owner: repositoryOwner,
|
owner: repositoryOwner,
|
||||||
@@ -72,30 +26,27 @@ export async function downloadArtifact(
|
|||||||
artifact_id: artifactId,
|
artifact_id: artifactId,
|
||||||
archive_format: 'zip',
|
archive_format: 'zip',
|
||||||
request: {
|
request: {
|
||||||
redirect: 'manual'
|
redirect: 'manual',
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
if (status !== 302) {
|
if (status !== 302) {
|
||||||
throw new Error(`Unable to download artifact. Unexpected status: ${status}`)
|
throw new Error(`Unable to download artifact. Unexpected status: ${status}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const {location} = headers
|
const { location } = headers
|
||||||
if (!location) {
|
if (!location) {
|
||||||
throw new Error(`Unable to redirect to artifact download url`)
|
throw new Error(`Unable to redirect to artifact download url`)
|
||||||
}
|
}
|
||||||
|
|
||||||
core.info(
|
const scrubbedURL = new URL(location);
|
||||||
`Redirecting to blob download url: ${scrubQueryParameters(location)}`
|
scrubbedURL.search = ''
|
||||||
)
|
console.log(`Redirecting to blob download url: ${scrubbedURL.toString()}`)
|
||||||
|
// const client = new httpClient.HttpClient(getUserAgentString(), [], {})
|
||||||
|
|
||||||
try {
|
// const response = await client.get(location)
|
||||||
core.info(`Starting download of artifact to: ${downloadPath}`)
|
|
||||||
await streamExtract(location, downloadPath)
|
|
||||||
core.info(`Artifact download completed successfully.`)
|
|
||||||
} catch (error) {
|
|
||||||
throw new Error(`Unable to download and extract artifact: ${error.message}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
return {success: true, downloadPath}
|
// response.message.pipe(unzipper.Extract({ path: options?.path }))
|
||||||
}
|
|
||||||
|
return {success: true}
|
||||||
|
}
|
||||||
@@ -1,12 +1,4 @@
|
|||||||
import {GetArtifactResponse} from '../shared/interfaces'
|
import {GetArtifactResponse} from '../shared/interfaces'
|
||||||
import {getOctokit} from '@actions/github'
|
|
||||||
import {getUserAgentString} from '../shared/user-agent'
|
|
||||||
import {defaults as defaultGitHubOptions} from '@actions/github/lib/utils'
|
|
||||||
import {getRetryOptions} from './retry-options'
|
|
||||||
import {requestLog} from '@octokit/plugin-request-log'
|
|
||||||
import {retry} from '@octokit/plugin-retry'
|
|
||||||
import * as core from '@actions/core'
|
|
||||||
import {OctokitOptions} from '@octokit/core/dist-types/types'
|
|
||||||
|
|
||||||
export async function getArtifact(
|
export async function getArtifact(
|
||||||
artifactName: string,
|
artifactName: string,
|
||||||
@@ -15,55 +7,5 @@ export async function getArtifact(
|
|||||||
repositoryName: string,
|
repositoryName: string,
|
||||||
token: string
|
token: string
|
||||||
): Promise<GetArtifactResponse> {
|
): Promise<GetArtifactResponse> {
|
||||||
const [retryOpts, requestOpts] = getRetryOptions(defaultGitHubOptions)
|
throw new Error('Not implemented')
|
||||||
|
|
||||||
const opts: OctokitOptions = {
|
|
||||||
log: undefined,
|
|
||||||
userAgent: getUserAgentString(),
|
|
||||||
previews: undefined,
|
|
||||||
retry: retryOpts,
|
|
||||||
request: requestOpts
|
|
||||||
}
|
|
||||||
|
|
||||||
const github = getOctokit(token, opts, retry, requestLog)
|
|
||||||
|
|
||||||
const getArtifactResp = await github.request(
|
|
||||||
'GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts{?name}',
|
|
||||||
{
|
|
||||||
owner: repositoryOwner,
|
|
||||||
repo: repositoryName,
|
|
||||||
run_id: workflowRunId,
|
|
||||||
name: artifactName
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
if (getArtifactResp.status !== 200) {
|
|
||||||
core.warning(`non-200 response from GitHub API: ${getArtifactResp.status}`)
|
|
||||||
return {
|
|
||||||
success: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getArtifactResp.data.artifacts.length === 0) {
|
|
||||||
core.warning('no artifacts found')
|
|
||||||
return {
|
|
||||||
success: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getArtifactResp.data.artifacts.length > 1) {
|
|
||||||
core.warning(
|
|
||||||
'more than one artifact found for a single name, returning first'
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
success: true,
|
|
||||||
artifact: {
|
|
||||||
name: getArtifactResp.data.artifacts[0].name,
|
|
||||||
id: getArtifactResp.data.artifacts[0].id,
|
|
||||||
url: getArtifactResp.data.artifacts[0].url,
|
|
||||||
size: getArtifactResp.data.artifacts[0].size_in_bytes
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,16 +2,26 @@ import {info, warning, debug} from '@actions/core'
|
|||||||
import {getOctokit} from '@actions/github'
|
import {getOctokit} from '@actions/github'
|
||||||
import {ListArtifactsResponse, Artifact} from '../shared/interfaces'
|
import {ListArtifactsResponse, Artifact} from '../shared/interfaces'
|
||||||
import {getUserAgentString} from '../shared/user-agent'
|
import {getUserAgentString} from '../shared/user-agent'
|
||||||
import {getRetryOptions} from './retry-options'
|
import {RetryOptions, getRetryOptions} from './retry-options'
|
||||||
import {defaults as defaultGitHubOptions} from '@actions/github/lib/utils'
|
import {defaults as defaultGitHubOptions} from '@actions/github/lib/utils'
|
||||||
import {requestLog} from '@octokit/plugin-request-log'
|
import {requestLog} from '@octokit/plugin-request-log'
|
||||||
import {retry} from '@octokit/plugin-retry'
|
import {retry} from '@octokit/plugin-retry'
|
||||||
import {OctokitOptions} from '@octokit/core/dist-types/types'
|
import {RequestRequestOptions} from '@octokit/types'
|
||||||
|
|
||||||
|
type Options = {
|
||||||
|
log?: Console
|
||||||
|
userAgent?: string
|
||||||
|
previews?: string[]
|
||||||
|
retry?: RetryOptions
|
||||||
|
request?: RequestRequestOptions
|
||||||
|
}
|
||||||
|
|
||||||
// Limiting to 1000 for perf reasons
|
// Limiting to 1000 for perf reasons
|
||||||
const maximumArtifactCount = 1000
|
const maximumArtifactCount = 1000
|
||||||
const paginationCount = 100
|
const paginationCount = 100
|
||||||
const maxNumberOfPages = maximumArtifactCount / paginationCount
|
const maxNumberOfPages = maximumArtifactCount / paginationCount
|
||||||
|
const maxRetryNumber = 5
|
||||||
|
const exemptStatusCodes = [400, 401, 403, 404, 422] // https://github.com/octokit/plugin-retry.js/blob/9a2443746c350b3beedec35cf26e197ea318a261/src/index.ts#L14
|
||||||
|
|
||||||
export async function listArtifacts(
|
export async function listArtifacts(
|
||||||
workflowRunId: number,
|
workflowRunId: number,
|
||||||
@@ -19,14 +29,16 @@ export async function listArtifacts(
|
|||||||
repositoryName: string,
|
repositoryName: string,
|
||||||
token: string
|
token: string
|
||||||
): Promise<ListArtifactsResponse> {
|
): Promise<ListArtifactsResponse> {
|
||||||
info(
|
info(`Fetching artifact list for workflow run ${workflowRunId} in repository ${repositoryOwner}/${repositoryName}`)
|
||||||
`Fetching artifact list for workflow run ${workflowRunId} in repository ${repositoryOwner}/${repositoryName}`
|
|
||||||
)
|
|
||||||
|
|
||||||
const artifacts: Artifact[] = []
|
const artifacts: Artifact[] = []
|
||||||
const [retryOpts, requestOpts] = getRetryOptions(defaultGitHubOptions)
|
const [retryOpts, requestOpts] = getRetryOptions(
|
||||||
|
maxRetryNumber,
|
||||||
|
exemptStatusCodes,
|
||||||
|
defaultGitHubOptions
|
||||||
|
)
|
||||||
|
|
||||||
const opts: OctokitOptions = {
|
const opts: Options = {
|
||||||
log: undefined,
|
log: undefined,
|
||||||
userAgent: getUserAgentString(),
|
userAgent: getUserAgentString(),
|
||||||
previews: undefined,
|
previews: undefined,
|
||||||
@@ -58,14 +70,14 @@ export async function listArtifacts(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Iterate over the first page
|
// Iterate over the first page
|
||||||
for (const artifact of listArtifactResponse.artifacts) {
|
listArtifactResponse.artifacts.forEach(artifact => {
|
||||||
artifacts.push({
|
artifacts.push({
|
||||||
name: artifact.name,
|
name: artifact.name,
|
||||||
id: artifact.id,
|
id: artifact.id,
|
||||||
url: artifact.url,
|
url: artifact.url,
|
||||||
size: artifact.size_in_bytes
|
size: artifact.size_in_bytes
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
|
|
||||||
// Iterate over any remaining pages
|
// Iterate over any remaining pages
|
||||||
for (
|
for (
|
||||||
@@ -85,19 +97,19 @@ export async function listArtifacts(
|
|||||||
page: currentPageNumber
|
page: currentPageNumber
|
||||||
})
|
})
|
||||||
|
|
||||||
for (const artifact of listArtifactResponse.artifacts) {
|
listArtifactResponse.artifacts.forEach(artifact => {
|
||||||
artifacts.push({
|
artifacts.push({
|
||||||
name: artifact.name,
|
name: artifact.name,
|
||||||
id: artifact.id,
|
id: artifact.id,
|
||||||
url: artifact.url,
|
url: artifact.url,
|
||||||
size: artifact.size_in_bytes
|
size: artifact.size_in_bytes
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
info(`Finished fetching artifact list`)
|
info(`Finished fetching artifact list`)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
artifacts
|
artifacts: artifacts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,14 +7,10 @@ export type RetryOptions = {
|
|||||||
enabled?: boolean
|
enabled?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
// Defaults for fetching artifacts
|
|
||||||
const defaultMaxRetryNumber = 5
|
|
||||||
const defaultExemptStatusCodes = [400, 401, 403, 404, 422] // https://github.com/octokit/plugin-retry.js/blob/9a2443746c350b3beedec35cf26e197ea318a261/src/index.ts#L14
|
|
||||||
|
|
||||||
export function getRetryOptions(
|
export function getRetryOptions(
|
||||||
defaultOptions: OctokitOptions,
|
retries: number,
|
||||||
retries: number = defaultMaxRetryNumber,
|
exemptStatusCodes: number[],
|
||||||
exemptStatusCodes: number[] = defaultExemptStatusCodes
|
defaultOptions: OctokitOptions
|
||||||
): [RetryOptions, RequestRequestOptions | undefined] {
|
): [RetryOptions, RequestRequestOptions | undefined] {
|
||||||
if (retries <= 0) {
|
if (retries <= 0) {
|
||||||
return [{enabled: false}, defaultOptions.request]
|
return [{enabled: false}, defaultOptions.request]
|
||||||
|
|||||||
@@ -26,11 +26,3 @@ export function isGhes(): boolean {
|
|||||||
)
|
)
|
||||||
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM'
|
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM'
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getGitHubWorkspaceDir(): string {
|
|
||||||
const ghWorkspaceDir = process.env['GITHUB_WORKSPACE']
|
|
||||||
if (!ghWorkspaceDir) {
|
|
||||||
throw new Error('Unable to get the GITHUB_WORKSPACE env variable')
|
|
||||||
}
|
|
||||||
return ghWorkspaceDir
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -80,10 +80,6 @@ export interface DownloadArtifactResponse {
|
|||||||
* If the artifact download was successful
|
* If the artifact download was successful
|
||||||
*/
|
*/
|
||||||
success: boolean
|
success: boolean
|
||||||
/**
|
|
||||||
* The path where the artifact was downloaded to
|
|
||||||
*/
|
|
||||||
downloadPath?: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DownloadArtifactOptions {
|
export interface DownloadArtifactOptions {
|
||||||
@@ -91,6 +87,12 @@ export interface DownloadArtifactOptions {
|
|||||||
* Denotes where the artifact will be downloaded to. If not specified then the artifact is download to GITHUB_WORKSPACE
|
* Denotes where the artifact will be downloaded to. If not specified then the artifact is download to GITHUB_WORKSPACE
|
||||||
*/
|
*/
|
||||||
path?: string
|
path?: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specifies if a root folder with the artifact name is created for the artifact that is downloaded
|
||||||
|
* Zip contents are expanded into this folder. Defaults to false if not specified
|
||||||
|
* */
|
||||||
|
createArtifactFolder?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports
|
var packageJson = require('../../../package.json')
|
||||||
const packageJson = require('../../../package.json')
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ensure that this User Agent String is used in all HTTP calls so that we can monitor telemetry between different versions of this package
|
* Ensure that this User Agent String is used in all HTTP calls so that we can monitor telemetry between different versions of this package
|
||||||
|
|||||||
@@ -91,6 +91,6 @@ export async function uploadZipToBlobStorage(
|
|||||||
return {
|
return {
|
||||||
isSuccess: true,
|
isSuccess: true,
|
||||||
uploadSize: uploadByteCount,
|
uploadSize: uploadByteCount,
|
||||||
md5Hash
|
md5Hash: md5Hash
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ export async function uploadArtifact(
|
|||||||
const createArtifactReq: CreateArtifactRequest = {
|
const createArtifactReq: CreateArtifactRequest = {
|
||||||
workflowRunBackendId: backendIds.workflowRunBackendId,
|
workflowRunBackendId: backendIds.workflowRunBackendId,
|
||||||
workflowJobRunBackendId: backendIds.workflowJobRunBackendId,
|
workflowJobRunBackendId: backendIds.workflowJobRunBackendId,
|
||||||
name,
|
name: name,
|
||||||
version: 4
|
version: 4
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,8 +71,9 @@ export async function uploadArtifact(
|
|||||||
createArtifactReq.expiresAt = expiresAt
|
createArtifactReq.expiresAt = expiresAt
|
||||||
}
|
}
|
||||||
|
|
||||||
const createArtifactResp =
|
const createArtifactResp = await artifactClient.CreateArtifact(
|
||||||
await artifactClient.CreateArtifact(createArtifactReq)
|
createArtifactReq
|
||||||
|
)
|
||||||
if (!createArtifactResp.ok) {
|
if (!createArtifactResp.ok) {
|
||||||
core.warning(`Failed to create artifact`)
|
core.warning(`Failed to create artifact`)
|
||||||
return {
|
return {
|
||||||
@@ -95,20 +96,21 @@ export async function uploadArtifact(
|
|||||||
const finalizeArtifactReq: FinalizeArtifactRequest = {
|
const finalizeArtifactReq: FinalizeArtifactRequest = {
|
||||||
workflowRunBackendId: backendIds.workflowRunBackendId,
|
workflowRunBackendId: backendIds.workflowRunBackendId,
|
||||||
workflowJobRunBackendId: backendIds.workflowJobRunBackendId,
|
workflowJobRunBackendId: backendIds.workflowJobRunBackendId,
|
||||||
name,
|
name: name,
|
||||||
size: uploadResult.uploadSize ? uploadResult.uploadSize.toString() : '0'
|
size: uploadResult.uploadSize!.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uploadResult.md5Hash) {
|
if (uploadResult.md5Hash) {
|
||||||
finalizeArtifactReq.hash = StringValue.create({
|
finalizeArtifactReq.hash = StringValue.create({
|
||||||
value: `md5:${uploadResult.md5Hash}`
|
value: `md5:${uploadResult.md5Hash!}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
core.info(`Finalizing artifact upload`)
|
core.info(`Finalizing artifact upload`)
|
||||||
|
|
||||||
const finalizeArtifactResp =
|
const finalizeArtifactResp = await artifactClient.FinalizeArtifact(
|
||||||
await artifactClient.FinalizeArtifact(finalizeArtifactReq)
|
finalizeArtifactReq
|
||||||
|
)
|
||||||
if (!finalizeArtifactResp.ok) {
|
if (!finalizeArtifactResp.ok) {
|
||||||
core.warning(`Failed to finalize artifact`)
|
core.warning(`Failed to finalize artifact`)
|
||||||
return {
|
return {
|
||||||
|
|||||||
+9
-9
@@ -17,13 +17,13 @@
|
|||||||
"@azure/abort-controller": "^1.1.0",
|
"@azure/abort-controller": "^1.1.0",
|
||||||
"@azure/ms-rest-js": "^2.6.0",
|
"@azure/ms-rest-js": "^2.6.0",
|
||||||
"@azure/storage-blob": "^12.13.0",
|
"@azure/storage-blob": "^12.13.0",
|
||||||
"semver": "^6.3.1",
|
"semver": "^6.1.0",
|
||||||
"uuid": "^3.3.3"
|
"uuid": "^3.3.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/semver": "^6.0.0",
|
"@types/semver": "^6.0.0",
|
||||||
"@types/uuid": "^3.4.5",
|
"@types/uuid": "^3.4.5",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^4.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
@@ -474,16 +474,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "5.2.2",
|
"version": "4.9.5",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
||||||
"integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
|
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.17"
|
"node": ">=4.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/uuid": {
|
"node_modules/uuid": {
|
||||||
@@ -895,9 +895,9 @@
|
|||||||
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
|
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "5.2.2",
|
"version": "4.9.5",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
||||||
"integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
|
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"uuid": {
|
"uuid": {
|
||||||
|
|||||||
Vendored
+2
-2
@@ -45,12 +45,12 @@
|
|||||||
"@azure/abort-controller": "^1.1.0",
|
"@azure/abort-controller": "^1.1.0",
|
||||||
"@azure/ms-rest-js": "^2.6.0",
|
"@azure/ms-rest-js": "^2.6.0",
|
||||||
"@azure/storage-blob": "^12.13.0",
|
"@azure/storage-blob": "^12.13.0",
|
||||||
"semver": "^6.3.1",
|
"semver": "^6.1.0",
|
||||||
"uuid": "^3.3.3"
|
"uuid": "^3.3.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/semver": "^6.0.0",
|
"@types/semver": "^6.0.0",
|
||||||
"@types/uuid": "^3.4.5",
|
"@types/uuid": "^3.4.5",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^4.8.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
# @actions/core Releases
|
# @actions/core Releases
|
||||||
|
|
||||||
### 1.10.1
|
|
||||||
- Fix error message reference in oidc utils [#1511](https://github.com/actions/toolkit/pull/1511)
|
|
||||||
|
|
||||||
### 1.10.0
|
### 1.10.0
|
||||||
- `saveState` and `setOutput` now use environment files if available [#1178](https://github.com/actions/toolkit/pull/1178)
|
- `saveState` and `setOutput` now use environment files if available [#1178](https://github.com/actions/toolkit/pull/1178)
|
||||||
- `getMultilineInput` now correctly trims whitespace by default [#1185](https://github.com/actions/toolkit/pull/1185)
|
- `getMultilineInput` now correctly trims whitespace by default [#1185](https://github.com/actions/toolkit/pull/1185)
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/core",
|
"name": "@actions/core",
|
||||||
"version": "1.10.1",
|
"version": "1.10.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/core",
|
"name": "@actions/core",
|
||||||
"version": "1.10.1",
|
"version": "1.10.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/core",
|
"name": "@actions/core",
|
||||||
"version": "1.10.1",
|
"version": "1.10.0",
|
||||||
"description": "Actions core lib",
|
"description": "Actions core lib",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"github",
|
"github",
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export class OidcClient {
|
|||||||
throw new Error(
|
throw new Error(
|
||||||
`Failed to get ID Token. \n
|
`Failed to get ID Token. \n
|
||||||
Error Code : ${error.statusCode}\n
|
Error Code : ${error.statusCode}\n
|
||||||
Error Message: ${error.message}`
|
Error Message: ${error.result.message}`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -631,7 +631,7 @@ class ExecState extends events.EventEmitter {
|
|||||||
private delay = 10000 // 10 seconds
|
private delay = 10000 // 10 seconds
|
||||||
private done = false
|
private done = false
|
||||||
private options: im.ExecOptions
|
private options: im.ExecOptions
|
||||||
private timeout: NodeJS.Timeout | null = null
|
private timeout: NodeJS.Timer | null = null
|
||||||
private toolPath: string
|
private toolPath: string
|
||||||
|
|
||||||
CheckComplete(): void {
|
CheckComplete(): void {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import * as http from 'http'
|
import * as http from 'http'
|
||||||
import * as https from 'https'
|
import * as https from 'https'
|
||||||
import { ProxyServer, createProxy } from "proxy";
|
import proxy from 'proxy'
|
||||||
import { ProxyAgent, fetch as undiciFetch } from "undici";
|
|
||||||
|
|
||||||
// Default values are set when the module is imported, so we need to set proxy first.
|
// Default values are set when the module is imported, so we need to set proxy first.
|
||||||
const proxyUrl = 'http://127.0.0.1:8081'
|
const proxyUrl = 'http://127.0.0.1:8081'
|
||||||
@@ -17,8 +16,8 @@ describe('@actions/github', () => {
|
|||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
// Start proxy server
|
// Start proxy server
|
||||||
proxyServer = createProxy()
|
proxyServer = proxy()
|
||||||
await new Promise<void>(resolve => {
|
await new Promise(resolve => {
|
||||||
const port = Number(proxyUrl.split(':')[2])
|
const port = Number(proxyUrl.split(':')[2])
|
||||||
proxyServer.listen(port, () => resolve())
|
proxyServer.listen(port, () => resolve())
|
||||||
})
|
})
|
||||||
@@ -33,7 +32,7 @@ describe('@actions/github', () => {
|
|||||||
|
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
// Stop proxy server
|
// Stop proxy server
|
||||||
await new Promise<void>(resolve => {
|
await new Promise(resolve => {
|
||||||
proxyServer.once('close', () => resolve())
|
proxyServer.once('close', () => resolve())
|
||||||
proxyServer.close()
|
proxyServer.close()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as http from 'http'
|
import * as http from 'http'
|
||||||
import { createProxy } from 'proxy'
|
import proxy from 'proxy'
|
||||||
import {getOctokit} from '../src/github'
|
import {getOctokit} from '../src/github'
|
||||||
import {GitHub, getOctokitOptions} from '../src/utils'
|
import {GitHub, getOctokitOptions} from '../src/utils'
|
||||||
|
|
||||||
@@ -12,10 +12,10 @@ describe('@actions/github', () => {
|
|||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
// Start proxy server
|
// Start proxy server
|
||||||
proxyServer = createProxy()
|
proxyServer = proxy()
|
||||||
await new Promise<void>(resolve => {
|
await new Promise(resolve => {
|
||||||
const port = Number(proxyUrl.split(':')[2])
|
const port = Number(proxyUrl.split(':')[2])
|
||||||
proxyServer.listen(port, () => resolve())
|
proxyServer.listen(port, () => resolve(null))
|
||||||
})
|
})
|
||||||
proxyServer.on('connect', req => {
|
proxyServer.on('connect', req => {
|
||||||
proxyConnects.push(req.url ?? '')
|
proxyConnects.push(req.url ?? '')
|
||||||
@@ -29,8 +29,8 @@ describe('@actions/github', () => {
|
|||||||
|
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
// Stop proxy server
|
// Stop proxy server
|
||||||
await new Promise<void>(resolve => {
|
await new Promise(resolve => {
|
||||||
proxyServer.once('close', () => resolve())
|
proxyServer.once('close', () => resolve(null))
|
||||||
proxyServer.close()
|
proxyServer.close()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Generated
+315
-428
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/github",
|
"name": "@actions/github",
|
||||||
"version": "6.0.2",
|
"version": "5.1.1",
|
||||||
"description": "Actions github lib",
|
"description": "Actions github lib",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"github",
|
"github",
|
||||||
@@ -38,14 +38,12 @@
|
|||||||
"url": "https://github.com/actions/toolkit/issues"
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/http-client": "file:actions-http-client-3.0.3.tgz",
|
"@actions/http-client": "^2.0.1",
|
||||||
"@octokit/core": "^4.2.4",
|
"@octokit/core": "^3.6.0",
|
||||||
"@octokit/plugin-paginate-rest": "^6.1.2",
|
"@octokit/plugin-paginate-rest": "^2.17.0",
|
||||||
"@octokit/plugin-rest-endpoint-methods": "^7.2.3",
|
"@octokit/plugin-rest-endpoint-methods": "^5.13.0"
|
||||||
"undici": "^5.25.2"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/proxy": "^1.0.1",
|
"proxy": "^1.0.2"
|
||||||
"proxy": "^2.1.1"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
import * as http from 'http'
|
import * as http from 'http'
|
||||||
import * as httpClient from '@actions/http-client'
|
import * as httpClient from '@actions/http-client'
|
||||||
import {OctokitOptions} from '@octokit/core/dist-types/types'
|
import {OctokitOptions} from '@octokit/core/dist-types/types'
|
||||||
import { ProxyAgent, Agent, fetch as undiciFetch } from "undici";
|
|
||||||
|
|
||||||
export function getAuthString(
|
export function getAuthString(
|
||||||
token: string,
|
token: string,
|
||||||
@@ -21,22 +20,6 @@ export function getProxyAgent(destinationUrl: string): http.Agent {
|
|||||||
return hc.getAgent(destinationUrl)
|
return hc.getAgent(destinationUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getProxyAgentDispatcher(destinationUrl: string): ProxyAgent | undefined {
|
|
||||||
const hc = new httpClient.HttpClient()
|
|
||||||
return hc.getAgentDispatcher(destinationUrl)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getProxyFetch(destinationUrl): any {
|
|
||||||
const httpAgent = getProxyAgentDispatcher(destinationUrl)
|
|
||||||
const proxyFetch: typeof undiciFetch = (url, opts) => {
|
|
||||||
return undiciFetch(url, {
|
|
||||||
...opts,
|
|
||||||
dispatcher: httpAgent,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return proxyFetch;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getApiBaseUrl(): string {
|
export function getApiBaseUrl(): string {
|
||||||
return process.env['GITHUB_API_URL'] || 'https://api.github.com'
|
return process.env['GITHUB_API_URL'] || 'https://api.github.com'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,7 @@ const baseUrl = Utils.getApiBaseUrl()
|
|||||||
export const defaults: OctokitOptions = {
|
export const defaults: OctokitOptions = {
|
||||||
baseUrl,
|
baseUrl,
|
||||||
request: {
|
request: {
|
||||||
agent: Utils.getProxyAgent(baseUrl),
|
agent: Utils.getProxyAgent(baseUrl)
|
||||||
fetch: Utils.getProxyFetch(baseUrl)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
import * as http from 'http'
|
import * as http from 'http'
|
||||||
import * as httpm from '../lib/'
|
import * as httpm from '../lib/'
|
||||||
import * as pm from '../lib/proxy'
|
import * as pm from '../lib/proxy'
|
||||||
import { ProxyAgent, Agent, fetch as undiciFetch } from "undici";
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports
|
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports
|
||||||
const proxy = require('proxy')
|
const proxy = require('proxy')
|
||||||
|
|
||||||
@@ -14,7 +13,7 @@ const _proxyUrl = 'http://127.0.0.1:8080'
|
|||||||
describe('proxy', () => {
|
describe('proxy', () => {
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
// Start proxy server
|
// Start proxy server
|
||||||
_proxyServer = proxy.createProxy()
|
_proxyServer = proxy()
|
||||||
await new Promise<void>(resolve => {
|
await new Promise<void>(resolve => {
|
||||||
const port = Number(_proxyUrl.split(':')[2])
|
const port = Number(_proxyUrl.split(':')[2])
|
||||||
_proxyServer.listen(port, () => resolve())
|
_proxyServer.listen(port, () => resolve())
|
||||||
@@ -295,23 +294,6 @@ describe('proxy', () => {
|
|||||||
expect(agent.proxyOptions.port).toBe('8080')
|
expect(agent.proxyOptions.port).toBe('8080')
|
||||||
expect(agent.proxyOptions.proxyAuth).toBe('user:password')
|
expect(agent.proxyOptions.proxyAuth).toBe('user:password')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('proxy settings return ProxyAgent', async () => {
|
|
||||||
process.env['https_proxy'] = 'http://127.0.0.1:8080'
|
|
||||||
const httpClient = new httpm.HttpClient()
|
|
||||||
const agent = httpClient.getAgentDispatcher('https://some-url')
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(agent)
|
|
||||||
expect(agent instanceof ProxyAgent).toBe(true)
|
|
||||||
})
|
|
||||||
|
|
||||||
// it('proxyAuth is set in tunnel agent when authentication is provided', async () => {
|
|
||||||
// const httpClient = new httpm.HttpClient()
|
|
||||||
// const agent: Agent | ProxyAgent = httpClient.getAgentDispatcher('https://some-url')
|
|
||||||
// // eslint-disable-next-line no-console
|
|
||||||
// console.log(agent)
|
|
||||||
// expect(agent instanceof Agent).toBe(true)
|
|
||||||
// })
|
|
||||||
})
|
})
|
||||||
|
|
||||||
function _clearVars(): void {
|
function _clearVars(): void {
|
||||||
|
|||||||
Binary file not shown.
Generated
+52
-116
@@ -1,48 +1,27 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/http-client",
|
"name": "@actions/http-client",
|
||||||
"version": "3.0.3",
|
"version": "2.1.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/http-client",
|
"name": "@actions/http-client",
|
||||||
"version": "3.0.3",
|
"version": "2.1.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tunnel": "^0.0.6"
|
"tunnel": "^0.0.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "20.7.1",
|
|
||||||
"@types/proxy": "^1.0.1",
|
|
||||||
"@types/tunnel": "0.0.3",
|
"@types/tunnel": "0.0.3",
|
||||||
"proxy": "^2.1.1",
|
"proxy": "^1.0.1"
|
||||||
"undici": "^5.25.4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@fastify/busboy": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==",
|
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "20.7.1",
|
"version": "12.12.31",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.31.tgz",
|
||||||
"integrity": "sha512-LT+OIXpp2kj4E2S/p91BMe+VgGX2+lfO+XTpfXhh+bCk2LkQtHZSub8ewFBMGP5ClysPjTDFa4sMI8Q3n4T0wg==",
|
"integrity": "sha512-T+wnJno8uh27G9c+1T+a1/WYCHzLeDqtsGJkoEdSp2X8RTh3oOCZQcUnjAx90CS8cmmADX51O0FI/tu9s0yssg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/proxy": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/proxy/-/proxy-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-NDNsg7YuClVzEenn9SUButu43blypWvljGsIkDV7HI4N9apjrS0aeeMTUG0PYa71lD1AvIgvjkBagqHDiomDjA==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@types/node": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@types/tunnel": {
|
"node_modules/@types/tunnel": {
|
||||||
"version": "0.0.3",
|
"version": "0.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/tunnel/-/tunnel-0.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/tunnel/-/tunnel-0.0.3.tgz",
|
||||||
@@ -65,9 +44,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/args": {
|
"node_modules/args": {
|
||||||
"version": "5.0.3",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/args/-/args-5.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/args/-/args-5.0.1.tgz",
|
||||||
"integrity": "sha512-h6k/zfFgusnv3i5TU08KQkVKuCPBtL/PWQbWkHUxvJrZ2nAyeaUupneemcrgn1xmqxPQsPIzwkUhOpoqPDRZuA==",
|
"integrity": "sha512-1kqmFCFsPffavQFGt8OxJdIcETti99kySRUPMpOhaGjL6mRJn8HFU1OxKY5bMqfZKUwTQc1mZkAjmGYaVOHFtQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"camelcase": "5.0.0",
|
"camelcase": "5.0.0",
|
||||||
@@ -80,9 +59,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/basic-auth-parser": {
|
"node_modules/basic-auth-parser": {
|
||||||
"version": "0.0.2-1",
|
"version": "0.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/basic-auth-parser/-/basic-auth-parser-0.0.2-1.tgz",
|
"resolved": "https://registry.npmjs.org/basic-auth-parser/-/basic-auth-parser-0.0.2.tgz",
|
||||||
"integrity": "sha512-GFj8iVxo9onSU6BnnQvVwqvxh60UcSHJEDnIk3z4B6iOjsKSmqe+ibW0Rsz7YO7IE1HG3D3tqCNIidP46SZVdQ==",
|
"integrity": "sha1-zp5xp38jwSee7NJlmypGJEwVbkE=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/camelcase": {
|
"node_modules/camelcase": {
|
||||||
@@ -120,30 +99,23 @@
|
|||||||
"node_modules/color-name": {
|
"node_modules/color-name": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||||
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
|
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/debug": {
|
"node_modules/debug": {
|
||||||
"version": "4.3.4",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
||||||
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
|
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
||||||
|
"deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ms": "2.1.2"
|
"ms": "^2.1.1"
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6.0"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"supports-color": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/escape-string-regexp": {
|
"node_modules/escape-string-regexp": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
||||||
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
|
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.8.0"
|
"node": ">=0.8.0"
|
||||||
@@ -152,7 +124,7 @@
|
|||||||
"node_modules/has-flag": {
|
"node_modules/has-flag": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
||||||
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
|
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=4"
|
"node": ">=4"
|
||||||
@@ -161,7 +133,7 @@
|
|||||||
"node_modules/leven": {
|
"node_modules/leven": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz",
|
||||||
"integrity": "sha512-nvVPLpIHUxCUoRLrFqTgSxXJ614d8AgQoWl7zPe/2VadE8+1dpU3LBhowRuBAcuwruWtOdD8oYC9jDNJjXDPyA==",
|
"integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
@@ -183,17 +155,17 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/proxy": {
|
"node_modules/proxy": {
|
||||||
"version": "2.1.1",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/proxy/-/proxy-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/proxy/-/proxy-1.0.2.tgz",
|
||||||
"integrity": "sha512-nLgd7zdUAOpB3ZO/xCkU8gy74UER7P0aihU8DkUsDS5ZoFwVCX7u8dy+cv5tVK8UaB/yminU1GiLWE26TKPYpg==",
|
"integrity": "sha512-KNac2ueWRpjbUh77OAFPZuNdfEqNynm9DD4xHT14CccGpW8wKZwEkN0yjlb7X9G9Z9F55N0Q+1z+WfgAhwYdzQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"args": "^5.0.3",
|
"args": "5.0.1",
|
||||||
"basic-auth-parser": "0.0.2-1",
|
"basic-auth-parser": "0.0.2",
|
||||||
"debug": "^4.3.4"
|
"debug": "^4.1.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"bin": {
|
||||||
"node": ">= 14"
|
"proxy": "bin/proxy.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/supports-color": {
|
"node_modules/supports-color": {
|
||||||
@@ -215,42 +187,15 @@
|
|||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"node_modules/undici": {
|
|
||||||
"version": "5.25.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/undici/-/undici-5.25.4.tgz",
|
|
||||||
"integrity": "sha512-450yJxT29qKMf3aoudzFpIciqpx6Pji3hEWaXqXmanbXF58LTAGCKxcJjxMXWu3iG+Mudgo3ZUfDB6YDFd/dAw==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@fastify/busboy": "^2.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.0"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fastify/busboy": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "20.7.1",
|
"version": "12.12.31",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.31.tgz",
|
||||||
"integrity": "sha512-LT+OIXpp2kj4E2S/p91BMe+VgGX2+lfO+XTpfXhh+bCk2LkQtHZSub8ewFBMGP5ClysPjTDFa4sMI8Q3n4T0wg==",
|
"integrity": "sha512-T+wnJno8uh27G9c+1T+a1/WYCHzLeDqtsGJkoEdSp2X8RTh3oOCZQcUnjAx90CS8cmmADX51O0FI/tu9s0yssg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/proxy": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/proxy/-/proxy-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-NDNsg7YuClVzEenn9SUButu43blypWvljGsIkDV7HI4N9apjrS0aeeMTUG0PYa71lD1AvIgvjkBagqHDiomDjA==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@types/node": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@types/tunnel": {
|
"@types/tunnel": {
|
||||||
"version": "0.0.3",
|
"version": "0.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/tunnel/-/tunnel-0.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/tunnel/-/tunnel-0.0.3.tgz",
|
||||||
@@ -270,9 +215,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"args": {
|
"args": {
|
||||||
"version": "5.0.3",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/args/-/args-5.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/args/-/args-5.0.1.tgz",
|
||||||
"integrity": "sha512-h6k/zfFgusnv3i5TU08KQkVKuCPBtL/PWQbWkHUxvJrZ2nAyeaUupneemcrgn1xmqxPQsPIzwkUhOpoqPDRZuA==",
|
"integrity": "sha512-1kqmFCFsPffavQFGt8OxJdIcETti99kySRUPMpOhaGjL6mRJn8HFU1OxKY5bMqfZKUwTQc1mZkAjmGYaVOHFtQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"camelcase": "5.0.0",
|
"camelcase": "5.0.0",
|
||||||
@@ -282,9 +227,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"basic-auth-parser": {
|
"basic-auth-parser": {
|
||||||
"version": "0.0.2-1",
|
"version": "0.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/basic-auth-parser/-/basic-auth-parser-0.0.2-1.tgz",
|
"resolved": "https://registry.npmjs.org/basic-auth-parser/-/basic-auth-parser-0.0.2.tgz",
|
||||||
"integrity": "sha512-GFj8iVxo9onSU6BnnQvVwqvxh60UcSHJEDnIk3z4B6iOjsKSmqe+ibW0Rsz7YO7IE1HG3D3tqCNIidP46SZVdQ==",
|
"integrity": "sha1-zp5xp38jwSee7NJlmypGJEwVbkE=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"camelcase": {
|
"camelcase": {
|
||||||
@@ -316,34 +261,34 @@
|
|||||||
"color-name": {
|
"color-name": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||||
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
|
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"debug": {
|
"debug": {
|
||||||
"version": "4.3.4",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
||||||
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
|
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"ms": "2.1.2"
|
"ms": "^2.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"escape-string-regexp": {
|
"escape-string-regexp": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
||||||
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
|
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"has-flag": {
|
"has-flag": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
||||||
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
|
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"leven": {
|
"leven": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz",
|
||||||
"integrity": "sha512-nvVPLpIHUxCUoRLrFqTgSxXJ614d8AgQoWl7zPe/2VadE8+1dpU3LBhowRuBAcuwruWtOdD8oYC9jDNJjXDPyA==",
|
"integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"mri": {
|
"mri": {
|
||||||
@@ -359,14 +304,14 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"proxy": {
|
"proxy": {
|
||||||
"version": "2.1.1",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/proxy/-/proxy-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/proxy/-/proxy-1.0.2.tgz",
|
||||||
"integrity": "sha512-nLgd7zdUAOpB3ZO/xCkU8gy74UER7P0aihU8DkUsDS5ZoFwVCX7u8dy+cv5tVK8UaB/yminU1GiLWE26TKPYpg==",
|
"integrity": "sha512-KNac2ueWRpjbUh77OAFPZuNdfEqNynm9DD4xHT14CccGpW8wKZwEkN0yjlb7X9G9Z9F55N0Q+1z+WfgAhwYdzQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"args": "^5.0.3",
|
"args": "5.0.1",
|
||||||
"basic-auth-parser": "0.0.2-1",
|
"basic-auth-parser": "0.0.2",
|
||||||
"debug": "^4.3.4"
|
"debug": "^4.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"supports-color": {
|
"supports-color": {
|
||||||
@@ -382,15 +327,6 @@
|
|||||||
"version": "0.0.6",
|
"version": "0.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
|
||||||
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
|
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
|
||||||
},
|
|
||||||
"undici": {
|
|
||||||
"version": "5.25.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/undici/-/undici-5.25.4.tgz",
|
|
||||||
"integrity": "sha512-450yJxT29qKMf3aoudzFpIciqpx6Pji3hEWaXqXmanbXF58LTAGCKxcJjxMXWu3iG+Mudgo3ZUfDB6YDFd/dAw==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@fastify/busboy": "^2.0.0"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/http-client",
|
"name": "@actions/http-client",
|
||||||
"version": "3.0.3",
|
"version": "2.1.1",
|
||||||
"description": "Actions Http Client",
|
"description": "Actions Http Client",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"github",
|
"github",
|
||||||
@@ -39,13 +39,10 @@
|
|||||||
"url": "https://github.com/actions/toolkit/issues"
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "20.7.1",
|
|
||||||
"@types/tunnel": "0.0.3",
|
"@types/tunnel": "0.0.3",
|
||||||
"proxy": "^2.1.1",
|
"proxy": "^1.0.1"
|
||||||
"undici": "^5.25.4",
|
|
||||||
"@types/proxy": "^1.0.1"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tunnel": "^0.0.6"
|
"tunnel": "^0.0.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,6 @@ import * as ifm from './interfaces'
|
|||||||
import * as net from 'net'
|
import * as net from 'net'
|
||||||
import * as pm from './proxy'
|
import * as pm from './proxy'
|
||||||
import * as tunnel from 'tunnel'
|
import * as tunnel from 'tunnel'
|
||||||
import { ProxyAgent, Agent, fetch as undiciFetch } from "undici";
|
|
||||||
|
|
||||||
export enum HttpCodes {
|
export enum HttpCodes {
|
||||||
OK = 200,
|
OK = 200,
|
||||||
@@ -138,8 +137,6 @@ export class HttpClient {
|
|||||||
private _maxRetries = 1
|
private _maxRetries = 1
|
||||||
private _agent: any
|
private _agent: any
|
||||||
private _proxyAgent: any
|
private _proxyAgent: any
|
||||||
private _agentDispatcher: any
|
|
||||||
private _proxyAgentDispatcher: any
|
|
||||||
private _keepAlive = false
|
private _keepAlive = false
|
||||||
private _disposed = false
|
private _disposed = false
|
||||||
|
|
||||||
@@ -567,18 +564,6 @@ export class HttpClient {
|
|||||||
return this._getAgent(parsedUrl)
|
return this._getAgent(parsedUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
getAgentDispatcher(serverUrl: string): ProxyAgent | undefined {
|
|
||||||
const parsedUrl = new URL(serverUrl)
|
|
||||||
const proxyUrl = pm.getProxyUrl(parsedUrl)
|
|
||||||
const useProxy = proxyUrl && proxyUrl.hostname
|
|
||||||
if (useProxy) {
|
|
||||||
return this._getProxyAgentDispatcher(parsedUrl, proxyUrl)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private _prepareRequest(
|
private _prepareRequest(
|
||||||
method: string,
|
method: string,
|
||||||
requestUrl: URL,
|
requestUrl: URL,
|
||||||
@@ -716,93 +701,6 @@ export class HttpClient {
|
|||||||
return agent
|
return agent
|
||||||
}
|
}
|
||||||
|
|
||||||
private _getProxyAgentDispatcher(parsedUrl: URL, proxyUrl: URL): ProxyAgent {
|
|
||||||
let proxyAgent
|
|
||||||
const useProxy = proxyUrl && proxyUrl.hostname
|
|
||||||
|
|
||||||
if (this._keepAlive && useProxy) {
|
|
||||||
proxyAgent = this._proxyAgentDispatcher
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this._keepAlive && !useProxy) {
|
|
||||||
proxyAgent = this._agentDispatcher
|
|
||||||
}
|
|
||||||
|
|
||||||
// if agent is already assigned use that agent.
|
|
||||||
if (proxyAgent) {
|
|
||||||
return proxyAgent
|
|
||||||
}
|
|
||||||
|
|
||||||
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) {
|
|
||||||
proxyAgent = new ProxyAgent({
|
|
||||||
uri: proxyUrl.href,
|
|
||||||
pipelining: (!this._keepAlive ? 0 : 1),
|
|
||||||
...((proxyUrl.username || proxyUrl.password) && {
|
|
||||||
token: `${proxyUrl.username}:${proxyUrl.password}`
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
private _getAgentDispatcher(parsedUrl: URL): Agent {
|
|
||||||
let agent;
|
|
||||||
|
|
||||||
if (this._keepAlive) {
|
|
||||||
agent = this._agentDispatcher
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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
|
|
||||||
}
|
|
||||||
|
|
||||||
// if reusing agent across request and tunneling agent isn't assigned create a new agent
|
|
||||||
if (!agent) {
|
|
||||||
agent = new Agent(
|
|
||||||
{
|
|
||||||
pipelining: (!this._keepAlive ? 0 : 1),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
this._agentDispatcher = 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.connect || {}, {
|
|
||||||
rejectUnauthorized: false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return agent
|
|
||||||
}
|
|
||||||
|
|
||||||
private async _performExponentialBackoff(retryNumber: number): Promise<void> {
|
private async _performExponentialBackoff(retryNumber: number): Promise<void> {
|
||||||
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber)
|
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber)
|
||||||
const ms: number = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber)
|
const ms: number = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber)
|
||||||
|
|||||||
@@ -167,12 +167,8 @@ function normalizeSeparators(p: string): string {
|
|||||||
function isUnixExecutable(stats: fs.Stats): boolean {
|
function isUnixExecutable(stats: fs.Stats): boolean {
|
||||||
return (
|
return (
|
||||||
(stats.mode & 1) > 0 ||
|
(stats.mode & 1) > 0 ||
|
||||||
((stats.mode & 8) > 0 &&
|
((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
|
||||||
process.getgid !== undefined &&
|
((stats.mode & 64) > 0 && stats.uid === process.getuid())
|
||||||
stats.gid === process.getgid()) ||
|
|
||||||
((stats.mode & 64) > 0 &&
|
|
||||||
process.getuid !== undefined &&
|
|
||||||
stats.uid === process.getuid())
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -15,8 +15,7 @@
|
|||||||
"@actions/http-client": [
|
"@actions/http-client": [
|
||||||
"packages/http-client"
|
"packages/http-client"
|
||||||
],
|
],
|
||||||
},
|
}
|
||||||
"useUnknownInCatchVariables": false
|
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
|
|||||||
Reference in New Issue
Block a user