Compare commits
30
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71bc34b2d5 | ||
|
|
c25ba9aa99 | ||
|
|
0d63834474 | ||
|
|
8f032d304a | ||
|
|
28b09e224f | ||
|
|
111c95866e | ||
|
|
ddc9c52eb6 | ||
|
|
9f29c14937 | ||
|
|
6d37c6eb2b | ||
|
|
6477ef1460 | ||
|
|
2e5b10e3bd | ||
|
|
8c1e6a00f0 | ||
|
|
b2d5fa216f | ||
|
|
c5c786523e | ||
|
|
63c648f3c2 | ||
|
|
ce31408ff5 | ||
|
|
e26febd988 | ||
|
|
b051b4bada | ||
|
|
a08d666c78 | ||
|
|
83bb7cdeef | ||
|
|
b552972717 | ||
|
|
e3b0601228 | ||
|
|
0956e634df | ||
|
|
c171cf52fb | ||
|
|
2f1b34f165 | ||
|
|
b61854c5ca | ||
|
|
3d652d3133 | ||
|
|
c3df0928e2 | ||
|
|
9d756b2bc9 | ||
|
|
67c3b7a45c |
@@ -26,10 +26,10 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set Node.js 16.x
|
- name: Set Node.js 20.x
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 20.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 16.x
|
- name: Set Node.js 20.x
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 20.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 16.x
|
- name: Set Node.js 20.x
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 20.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 16.x
|
- name: Set Node.js 20.x
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 20.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 16.x
|
- name: Set Node.js 20.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 20.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@v1
|
uses: github/codeql-action/init@v2
|
||||||
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@v1
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v1
|
uses: github/codeql-action/analyze@v2
|
||||||
|
|||||||
@@ -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 16.x
|
- name: Set Node.js 20.x
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 20.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 16.x
|
- name: Set Node.js 20.x
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 20.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
|
run: npm test -- --runInBand --forceExit
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
|
|||||||
Generated
+1193
-1400
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": "^27.0.2",
|
"@types/jest": "^29.5.4",
|
||||||
"@types/node": "^16.18.1",
|
"@types/node": "^20.5.7",
|
||||||
"@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": "^27.2.5",
|
"jest": "^29.6.4",
|
||||||
"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": "^27.0.5",
|
"ts-jest": "^29.1.1",
|
||||||
"typescript": "^3.9.9"
|
"typescript": "^5.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,279 @@
|
|||||||
|
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)
|
||||||
|
})
|
||||||
|
})
|
||||||
Generated
+5
-5
@@ -27,7 +27,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/archiver": "^5.3.2",
|
"@types/archiver": "^5.3.2",
|
||||||
"typescript": "^4.3.0"
|
"typescript": "^5.2.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
@@ -1346,16 +1346,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "4.9.5",
|
"version": "5.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
|
||||||
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
"integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=4.2.0"
|
"node": ">=14.17"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/universal-user-agent": {
|
"node_modules/universal-user-agent": {
|
||||||
|
|||||||
@@ -57,6 +57,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/archiver": "^5.3.2",
|
"@types/archiver": "^5.3.2",
|
||||||
"typescript": "^4.3.0"
|
"typescript": "^5.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,12 +39,7 @@ async function streamExtract(url: string, directory: string): Promise<void> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return response.message.pipe(unzipper.Extract({path: directory})).promise()
|
||||||
response.message
|
|
||||||
.pipe(unzipper.Extract({path: directory}))
|
|
||||||
.on('finish', resolve)
|
|
||||||
.on('error', reject)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function downloadArtifact(
|
export async function downloadArtifact(
|
||||||
|
|||||||
@@ -71,9 +71,8 @@ export async function uploadArtifact(
|
|||||||
createArtifactReq.expiresAt = expiresAt
|
createArtifactReq.expiresAt = expiresAt
|
||||||
}
|
}
|
||||||
|
|
||||||
const createArtifactResp = await artifactClient.CreateArtifact(
|
const createArtifactResp =
|
||||||
createArtifactReq
|
await artifactClient.CreateArtifact(createArtifactReq)
|
||||||
)
|
|
||||||
if (!createArtifactResp.ok) {
|
if (!createArtifactResp.ok) {
|
||||||
core.warning(`Failed to create artifact`)
|
core.warning(`Failed to create artifact`)
|
||||||
return {
|
return {
|
||||||
@@ -108,9 +107,8 @@ export async function uploadArtifact(
|
|||||||
|
|
||||||
core.info(`Finalizing artifact upload`)
|
core.info(`Finalizing artifact upload`)
|
||||||
|
|
||||||
const finalizeArtifactResp = await artifactClient.FinalizeArtifact(
|
const finalizeArtifactResp =
|
||||||
finalizeArtifactReq
|
await artifactClient.FinalizeArtifact(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.1.0",
|
"semver": "^6.3.1",
|
||||||
"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": "^4.8.0"
|
"typescript": "^5.2.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
@@ -474,16 +474,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "4.9.5",
|
"version": "5.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
|
||||||
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
"integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=4.2.0"
|
"node": ">=14.17"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/uuid": {
|
"node_modules/uuid": {
|
||||||
@@ -895,9 +895,9 @@
|
|||||||
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
|
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "4.9.5",
|
"version": "5.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
|
||||||
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
"integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
|
||||||
"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.1.0",
|
"semver": "^6.3.1",
|
||||||
"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": "^4.8.0"
|
"typescript": "^5.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
# @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.0",
|
"version": "1.10.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/core",
|
"name": "@actions/core",
|
||||||
"version": "1.10.0",
|
"version": "1.10.1",
|
||||||
"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.0",
|
"version": "1.10.1",
|
||||||
"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.result.message}`
|
Error Message: ${error.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.Timer | null = null
|
private timeout: NodeJS.Timeout | null = null
|
||||||
private toolPath: string
|
private toolPath: string
|
||||||
|
|
||||||
CheckComplete(): void {
|
CheckComplete(): void {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import * as http from 'http'
|
import * as http from 'http'
|
||||||
import * as https from 'https'
|
import * as https from 'https'
|
||||||
import proxy from 'proxy'
|
import { ProxyServer, createProxy } 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'
|
||||||
@@ -16,8 +17,8 @@ describe('@actions/github', () => {
|
|||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
// Start proxy server
|
// Start proxy server
|
||||||
proxyServer = proxy()
|
proxyServer = createProxy()
|
||||||
await new Promise(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())
|
||||||
})
|
})
|
||||||
@@ -32,7 +33,7 @@ describe('@actions/github', () => {
|
|||||||
|
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
// Stop proxy server
|
// Stop proxy server
|
||||||
await new Promise(resolve => {
|
await new Promise<void>(resolve => {
|
||||||
proxyServer.once('close', () => resolve())
|
proxyServer.once('close', () => resolve())
|
||||||
proxyServer.close()
|
proxyServer.close()
|
||||||
})
|
})
|
||||||
@@ -49,6 +50,7 @@ describe('@actions/github', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const octokit = getOctokit(token)
|
const octokit = getOctokit(token)
|
||||||
|
|
||||||
const branch = await octokit.rest.repos.getBranch({
|
const branch = await octokit.rest.repos.getBranch({
|
||||||
owner: 'actions',
|
owner: 'actions',
|
||||||
repo: 'toolkit',
|
repo: 'toolkit',
|
||||||
@@ -64,6 +66,17 @@ describe('@actions/github', () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
process.env['https_proxy'] = proxyUrl
|
process.env['https_proxy'] = proxyUrl
|
||||||
|
// const myFetch: typeof undiciFetch = (url, opts) => {
|
||||||
|
// return undiciFetch(url, {
|
||||||
|
// ...opts,
|
||||||
|
// dispatcher: new ProxyAgent({
|
||||||
|
// uri: proxyUrl,
|
||||||
|
// keepAliveTimeout: 10,
|
||||||
|
// keepAliveMaxTimeout: 10,
|
||||||
|
// }),
|
||||||
|
// });
|
||||||
|
// };
|
||||||
|
|
||||||
const octokit = getOctokit(token)
|
const octokit = getOctokit(token)
|
||||||
|
|
||||||
const repository = await octokit.graphql(
|
const repository = await octokit.graphql(
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as http from 'http'
|
import * as http from 'http'
|
||||||
import proxy from 'proxy'
|
import { createProxy } 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 = proxy()
|
proxyServer = createProxy()
|
||||||
await new Promise(resolve => {
|
await new Promise<void>(resolve => {
|
||||||
const port = Number(proxyUrl.split(':')[2])
|
const port = Number(proxyUrl.split(':')[2])
|
||||||
proxyServer.listen(port, () => resolve(null))
|
proxyServer.listen(port, () => resolve())
|
||||||
})
|
})
|
||||||
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(resolve => {
|
await new Promise<void>(resolve => {
|
||||||
proxyServer.once('close', () => resolve(null))
|
proxyServer.once('close', () => resolve())
|
||||||
proxyServer.close()
|
proxyServer.close()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Generated
+458
-320
File diff suppressed because it is too large
Load Diff
@@ -38,12 +38,14 @@
|
|||||||
"url": "https://github.com/actions/toolkit/issues"
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "file:../http-client/actions-http-client-3.0.0.tgz",
|
||||||
"@octokit/core": "^3.6.0",
|
"@octokit/core": "^4.2.4",
|
||||||
"@octokit/plugin-paginate-rest": "^2.17.0",
|
"@octokit/plugin-paginate-rest": "^6.1.2",
|
||||||
"@octokit/plugin-rest-endpoint-methods": "^5.13.0"
|
"@octokit/plugin-rest-endpoint-methods": "^7.2.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"proxy": "^1.0.2"
|
"@types/proxy": "^1.0.1",
|
||||||
|
"proxy": "^2.1.1",
|
||||||
|
"undici": "^5.25.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
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 { ProxyServer, createProxy } from "proxy";
|
||||||
|
import { ProxyAgent, Agent, fetch as undiciFetch } from "undici";
|
||||||
|
|
||||||
export function getAuthString(
|
export function getAuthString(
|
||||||
token: string,
|
token: string,
|
||||||
@@ -20,6 +22,22 @@ export function getProxyAgent(destinationUrl: string): http.Agent {
|
|||||||
return hc.getAgent(destinationUrl)
|
return hc.getAgent(destinationUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getNewProxyAgent(destinationUrl: string): ProxyAgent | Agent {
|
||||||
|
const hc = new httpClient.HttpClient()
|
||||||
|
return hc.getNewAgent(destinationUrl)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getProxyFetchAgent(destinationUrl): any {
|
||||||
|
const httpAgent = getNewProxyAgent(destinationUrl)
|
||||||
|
const myFetch: typeof undiciFetch = (url, opts) => {
|
||||||
|
return undiciFetch(url, {
|
||||||
|
...opts,
|
||||||
|
dispatcher: httpAgent,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
return myFetch;
|
||||||
|
}
|
||||||
|
|
||||||
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,7 +13,7 @@ const baseUrl = Utils.getApiBaseUrl()
|
|||||||
export const defaults: OctokitOptions = {
|
export const defaults: OctokitOptions = {
|
||||||
baseUrl,
|
baseUrl,
|
||||||
request: {
|
request: {
|
||||||
agent: Utils.getProxyAgent(baseUrl)
|
fetch: Utils.getProxyFetchAgent(baseUrl)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Generated
+137
-52
@@ -1,27 +1,39 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/http-client",
|
"name": "@actions/http-client",
|
||||||
"version": "2.1.1",
|
"version": "3.0.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/http-client",
|
"name": "@actions/http-client",
|
||||||
"version": "2.1.1",
|
"version": "3.0.0",
|
||||||
"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.2",
|
||||||
"@types/tunnel": "0.0.3",
|
"@types/tunnel": "0.0.3",
|
||||||
"proxy": "^1.0.1"
|
"proxy": "^2.1.1",
|
||||||
|
"undici": "^5.25.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "12.12.31",
|
"version": "20.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.31.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.7.1.tgz",
|
||||||
"integrity": "sha512-T+wnJno8uh27G9c+1T+a1/WYCHzLeDqtsGJkoEdSp2X8RTh3oOCZQcUnjAx90CS8cmmADX51O0FI/tu9s0yssg==",
|
"integrity": "sha512-LT+OIXpp2kj4E2S/p91BMe+VgGX2+lfO+XTpfXhh+bCk2LkQtHZSub8ewFBMGP5ClysPjTDFa4sMI8Q3n4T0wg==",
|
||||||
"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",
|
||||||
@@ -44,9 +56,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/args": {
|
"node_modules/args": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/args/-/args-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/args/-/args-5.0.3.tgz",
|
||||||
"integrity": "sha512-1kqmFCFsPffavQFGt8OxJdIcETti99kySRUPMpOhaGjL6mRJn8HFU1OxKY5bMqfZKUwTQc1mZkAjmGYaVOHFtQ==",
|
"integrity": "sha512-h6k/zfFgusnv3i5TU08KQkVKuCPBtL/PWQbWkHUxvJrZ2nAyeaUupneemcrgn1xmqxPQsPIzwkUhOpoqPDRZuA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"camelcase": "5.0.0",
|
"camelcase": "5.0.0",
|
||||||
@@ -59,11 +71,23 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/basic-auth-parser": {
|
"node_modules/basic-auth-parser": {
|
||||||
"version": "0.0.2",
|
"version": "0.0.2-1",
|
||||||
"resolved": "https://registry.npmjs.org/basic-auth-parser/-/basic-auth-parser-0.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/basic-auth-parser/-/basic-auth-parser-0.0.2-1.tgz",
|
||||||
"integrity": "sha1-zp5xp38jwSee7NJlmypGJEwVbkE=",
|
"integrity": "sha512-GFj8iVxo9onSU6BnnQvVwqvxh60UcSHJEDnIk3z4B6iOjsKSmqe+ibW0Rsz7YO7IE1HG3D3tqCNIidP46SZVdQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/busboy": {
|
||||||
|
"version": "1.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz",
|
||||||
|
"integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"streamsearch": "^1.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.16.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/camelcase": {
|
"node_modules/camelcase": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz",
|
||||||
@@ -99,23 +123,30 @@
|
|||||||
"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": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
|
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/debug": {
|
"node_modules/debug": {
|
||||||
"version": "4.1.1",
|
"version": "4.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
||||||
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
|
||||||
"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.1"
|
"ms": "2.1.2"
|
||||||
|
},
|
||||||
|
"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": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
|
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.8.0"
|
"node": ">=0.8.0"
|
||||||
@@ -124,7 +155,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": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
|
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=4"
|
"node": ">=4"
|
||||||
@@ -133,7 +164,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": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=",
|
"integrity": "sha512-nvVPLpIHUxCUoRLrFqTgSxXJ614d8AgQoWl7zPe/2VadE8+1dpU3LBhowRuBAcuwruWtOdD8oYC9jDNJjXDPyA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
@@ -155,17 +186,26 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/proxy": {
|
"node_modules/proxy": {
|
||||||
"version": "1.0.2",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/proxy/-/proxy-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/proxy/-/proxy-2.1.1.tgz",
|
||||||
"integrity": "sha512-KNac2ueWRpjbUh77OAFPZuNdfEqNynm9DD4xHT14CccGpW8wKZwEkN0yjlb7X9G9Z9F55N0Q+1z+WfgAhwYdzQ==",
|
"integrity": "sha512-nLgd7zdUAOpB3ZO/xCkU8gy74UER7P0aihU8DkUsDS5ZoFwVCX7u8dy+cv5tVK8UaB/yminU1GiLWE26TKPYpg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"args": "5.0.1",
|
"args": "^5.0.3",
|
||||||
"basic-auth-parser": "0.0.2",
|
"basic-auth-parser": "0.0.2-1",
|
||||||
"debug": "^4.1.1"
|
"debug": "^4.3.4"
|
||||||
},
|
},
|
||||||
"bin": {
|
"engines": {
|
||||||
"proxy": "bin/proxy.js"
|
"node": ">= 14"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/streamsearch": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/supports-color": {
|
"node_modules/supports-color": {
|
||||||
@@ -187,15 +227,36 @@
|
|||||||
"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.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/undici/-/undici-5.25.2.tgz",
|
||||||
|
"integrity": "sha512-tch8RbCfn1UUH1PeVCXva4V8gDpGAud/w0WubD6sHC46vYQ3KDxL+xv1A2UxK0N6jrVedutuPHxe1XIoqerwMw==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"busboy": "^1.6.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "12.12.31",
|
"version": "20.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.31.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.7.1.tgz",
|
||||||
"integrity": "sha512-T+wnJno8uh27G9c+1T+a1/WYCHzLeDqtsGJkoEdSp2X8RTh3oOCZQcUnjAx90CS8cmmADX51O0FI/tu9s0yssg==",
|
"integrity": "sha512-LT+OIXpp2kj4E2S/p91BMe+VgGX2+lfO+XTpfXhh+bCk2LkQtHZSub8ewFBMGP5ClysPjTDFa4sMI8Q3n4T0wg==",
|
||||||
"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",
|
||||||
@@ -215,9 +276,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"args": {
|
"args": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/args/-/args-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/args/-/args-5.0.3.tgz",
|
||||||
"integrity": "sha512-1kqmFCFsPffavQFGt8OxJdIcETti99kySRUPMpOhaGjL6mRJn8HFU1OxKY5bMqfZKUwTQc1mZkAjmGYaVOHFtQ==",
|
"integrity": "sha512-h6k/zfFgusnv3i5TU08KQkVKuCPBtL/PWQbWkHUxvJrZ2nAyeaUupneemcrgn1xmqxPQsPIzwkUhOpoqPDRZuA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"camelcase": "5.0.0",
|
"camelcase": "5.0.0",
|
||||||
@@ -227,11 +288,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"basic-auth-parser": {
|
"basic-auth-parser": {
|
||||||
"version": "0.0.2",
|
"version": "0.0.2-1",
|
||||||
"resolved": "https://registry.npmjs.org/basic-auth-parser/-/basic-auth-parser-0.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/basic-auth-parser/-/basic-auth-parser-0.0.2-1.tgz",
|
||||||
"integrity": "sha1-zp5xp38jwSee7NJlmypGJEwVbkE=",
|
"integrity": "sha512-GFj8iVxo9onSU6BnnQvVwqvxh60UcSHJEDnIk3z4B6iOjsKSmqe+ibW0Rsz7YO7IE1HG3D3tqCNIidP46SZVdQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"busboy": {
|
||||||
|
"version": "1.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz",
|
||||||
|
"integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"streamsearch": "^1.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"camelcase": {
|
"camelcase": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz",
|
||||||
@@ -261,34 +331,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": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
|
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"debug": {
|
"debug": {
|
||||||
"version": "4.1.1",
|
"version": "4.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
||||||
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"ms": "^2.1.1"
|
"ms": "2.1.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"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": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
|
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
|
||||||
"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": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
|
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
|
||||||
"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": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=",
|
"integrity": "sha512-nvVPLpIHUxCUoRLrFqTgSxXJ614d8AgQoWl7zPe/2VadE8+1dpU3LBhowRuBAcuwruWtOdD8oYC9jDNJjXDPyA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"mri": {
|
"mri": {
|
||||||
@@ -304,16 +374,22 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"proxy": {
|
"proxy": {
|
||||||
"version": "1.0.2",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/proxy/-/proxy-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/proxy/-/proxy-2.1.1.tgz",
|
||||||
"integrity": "sha512-KNac2ueWRpjbUh77OAFPZuNdfEqNynm9DD4xHT14CccGpW8wKZwEkN0yjlb7X9G9Z9F55N0Q+1z+WfgAhwYdzQ==",
|
"integrity": "sha512-nLgd7zdUAOpB3ZO/xCkU8gy74UER7P0aihU8DkUsDS5ZoFwVCX7u8dy+cv5tVK8UaB/yminU1GiLWE26TKPYpg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"args": "5.0.1",
|
"args": "^5.0.3",
|
||||||
"basic-auth-parser": "0.0.2",
|
"basic-auth-parser": "0.0.2-1",
|
||||||
"debug": "^4.1.1"
|
"debug": "^4.3.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"streamsearch": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"supports-color": {
|
"supports-color": {
|
||||||
"version": "5.5.0",
|
"version": "5.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||||
@@ -327,6 +403,15 @@
|
|||||||
"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.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/undici/-/undici-5.25.2.tgz",
|
||||||
|
"integrity": "sha512-tch8RbCfn1UUH1PeVCXva4V8gDpGAud/w0WubD6sHC46vYQ3KDxL+xv1A2UxK0N6jrVedutuPHxe1XIoqerwMw==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"busboy": "^1.6.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/http-client",
|
"name": "@actions/http-client",
|
||||||
"version": "2.1.1",
|
"version": "3.0.0",
|
||||||
"description": "Actions Http Client",
|
"description": "Actions Http Client",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"github",
|
"github",
|
||||||
@@ -39,10 +39,13 @@
|
|||||||
"url": "https://github.com/actions/toolkit/issues"
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/node": "^20.7.1",
|
||||||
|
"@types/proxy": "^1.0.2",
|
||||||
"@types/tunnel": "0.0.3",
|
"@types/tunnel": "0.0.3",
|
||||||
"proxy": "^1.0.1"
|
"proxy": "^2.1.1",
|
||||||
|
"undici": "^5.25.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tunnel": "^0.0.6"
|
"tunnel": "^0.0.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ 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,
|
||||||
@@ -136,7 +137,9 @@ export class HttpClient {
|
|||||||
private _allowRetries = false
|
private _allowRetries = false
|
||||||
private _maxRetries = 1
|
private _maxRetries = 1
|
||||||
private _agent: any
|
private _agent: any
|
||||||
|
private _newAgent: any
|
||||||
private _proxyAgent: any
|
private _proxyAgent: any
|
||||||
|
private _newProxyAgent: any
|
||||||
private _keepAlive = false
|
private _keepAlive = false
|
||||||
private _disposed = false
|
private _disposed = false
|
||||||
|
|
||||||
@@ -564,6 +567,18 @@ export class HttpClient {
|
|||||||
return this._getAgent(parsedUrl)
|
return this._getAgent(parsedUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getNewAgent(serverUrl: string): ProxyAgent | Agent {
|
||||||
|
const parsedUrl = new URL(serverUrl)
|
||||||
|
const proxyUrl = pm.getProxyUrl(parsedUrl)
|
||||||
|
const useProxy = proxyUrl && proxyUrl.hostname
|
||||||
|
if (useProxy) {
|
||||||
|
return this._getProxyAgent(parsedUrl)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return this._getNewAgent(parsedUrl)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private _prepareRequest(
|
private _prepareRequest(
|
||||||
method: string,
|
method: string,
|
||||||
requestUrl: URL,
|
requestUrl: URL,
|
||||||
@@ -679,7 +694,7 @@ export class HttpClient {
|
|||||||
|
|
||||||
// if reusing agent across request and tunneling agent isn't assigned create a new agent
|
// if reusing agent across request and tunneling agent isn't assigned create a new agent
|
||||||
if (this._keepAlive && !agent) {
|
if (this._keepAlive && !agent) {
|
||||||
const options = {keepAlive: this._keepAlive, maxSockets}
|
const options = { keepAlive: this._keepAlive, maxSockets }
|
||||||
agent = usingSsl ? new https.Agent(options) : new http.Agent(options)
|
agent = usingSsl ? new https.Agent(options) : new http.Agent(options)
|
||||||
this._agent = agent
|
this._agent = agent
|
||||||
}
|
}
|
||||||
@@ -701,6 +716,94 @@ export class HttpClient {
|
|||||||
return agent
|
return agent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _getProxyAgent(parsedUrl: URL): ProxyAgent {
|
||||||
|
let proxyAgent
|
||||||
|
const proxyUrl = pm.getProxyUrl(parsedUrl)
|
||||||
|
const useProxy = proxyUrl && proxyUrl.hostname
|
||||||
|
|
||||||
|
if (this._keepAlive && useProxy) {
|
||||||
|
proxyAgent = this._newProxyAgent
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._keepAlive && !useProxy) {
|
||||||
|
proxyAgent = this._newAgent
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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._newProxyAgent = 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 _getNewAgent(parsedUrl: URL): Agent {
|
||||||
|
let agent;
|
||||||
|
|
||||||
|
if (this._keepAlive) {
|
||||||
|
agent = this._newAgent
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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 (this._keepAlive && !agent) {
|
||||||
|
agent = new Agent(
|
||||||
|
{
|
||||||
|
pipelining: (!this._keepAlive ? 0 : 1),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
this._newAgent = 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)
|
||||||
@@ -783,5 +886,5 @@ export class HttpClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const lowercaseKeys = (obj: {[index: string]: any}): any =>
|
const lowercaseKeys = (obj: { [index: string]: any }): any =>
|
||||||
Object.keys(obj).reduce((c: any, k) => ((c[k.toLowerCase()] = obj[k]), c), {})
|
Object.keys(obj).reduce((c: any, k) => ((c[k.toLowerCase()] = obj[k]), c), {})
|
||||||
|
|||||||
@@ -167,8 +167,12 @@ 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.gid === process.getgid()) ||
|
((stats.mode & 8) > 0 &&
|
||||||
((stats.mode & 64) > 0 && stats.uid === process.getuid())
|
process.getgid !== undefined &&
|
||||||
|
stats.gid === process.getgid()) ||
|
||||||
|
((stats.mode & 64) > 0 &&
|
||||||
|
process.getuid !== undefined &&
|
||||||
|
stats.uid === process.getuid())
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -15,7 +15,8 @@
|
|||||||
"@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