Compare commits
109 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a99da03c77 | |||
| e0023baa89 | |||
| 17bd5c18e9 | |||
| 4b6dd2fbd0 | |||
| d6c6f72a70 | |||
| 819157bf87 | |||
| 86102e88e9 | |||
| e4c071ba19 | |||
| 9443e26349 | |||
| 5a0405df4e | |||
| 0e707aeabc | |||
| 7441dc5e59 | |||
| 1ddac5e02f | |||
| 55484166d8 | |||
| 7181b913f5 | |||
| 81cd5a5c2e | |||
| 4b348086a9 | |||
| 436cf8d6ea | |||
| e0aadb573c | |||
| 62a66a8ce9 | |||
| 0c58e4113e | |||
| 9366237c90 | |||
| b36e70495f | |||
| 8423354d7d | |||
| abcca5a0b2 | |||
| b2e1c39c92 | |||
| 8e8a93deae | |||
| 738c849e89 | |||
| 9b58167dc9 | |||
| ffb7e3e14e | |||
| ce378c4cec | |||
| 3e257b0745 | |||
| e5e4491ac5 | |||
| 1bc93f3cdf | |||
| 4fbc5c941a | |||
| ac778acad2 | |||
| 192c26f865 | |||
| 295cbcc4da | |||
| b00a9fd033 | |||
| 4df45177e4 | |||
| 33f1d64363 | |||
| ebe4ac336f | |||
| 94de2cf6d4 | |||
| 64c334f0e5 | |||
| e1bb04bace | |||
| 0388e62759 | |||
| e6257f1117 | |||
| b7db7552c9 | |||
| 2c50af36e2 | |||
| aac665d186 | |||
| bc4be50597 | |||
| 0982f1da89 | |||
| ed96e21792 | |||
| 2ae31879b7 | |||
| 14d8f65f10 | |||
| f47a9aff5e | |||
| ce68daa10e | |||
| a57a4fe011 | |||
| 6c9b023c1b | |||
| 0be752bc46 | |||
| 5c5e91f040 | |||
| 846a0af6ec | |||
| 4b6b45fe18 | |||
| 98a4069558 | |||
| 6e888c882e | |||
| c202c38407 | |||
| d543359fab | |||
| 8bd9e29d3c | |||
| 63c66cf07e | |||
| 556b1c57e7 | |||
| a4276ac40f | |||
| c7340e91af | |||
| d714ea08d6 | |||
| 3fd7f664a6 | |||
| 30995490f2 | |||
| 4beda9cbc0 | |||
| ba462956ea | |||
| cf5d2b8fac | |||
| f9d38b0015 | |||
| 23cfbb3484 | |||
| 83becb7900 | |||
| ef888588c1 | |||
| f05c04b173 | |||
| 518f480528 | |||
| 90be12a59c | |||
| fe1ee8b6b4 | |||
| c89375df9f | |||
| 7cb82599d4 | |||
| 8be69a26ed | |||
| 970264135a | |||
| e5e69a3171 | |||
| 567598fdd7 | |||
| d8b119ca22 | |||
| a438f61f94 | |||
| 388d774221 | |||
| 9b309c5a32 | |||
| 01e1ff7bc0 | |||
| 74ff60c561 | |||
| e98bae803b | |||
| dd553d68ce | |||
| 74dd6f6817 | |||
| 83bca5cb13 | |||
| 2a37ee752b | |||
| ec95a9b114 | |||
| 67cb82d99b | |||
| da6701aea9 | |||
| 593bc7061c | |||
| 120202a68c | |||
| 8b45e1e356 |
@@ -221,7 +221,7 @@ console.log(`We can even get context data, like the repo: ${context.repo.repo}`)
|
|||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
We welcome contributions. See [how to contribute](.github/CONTRIBUTING.md).
|
We welcome contributions. See [how to contribute](.github/CONTRIBUTING.md).
|
||||||
|
hi
|
||||||
## Code of Conduct
|
## Code of Conduct
|
||||||
|
|
||||||
See [our code of conduct](CODE_OF_CONDUCT.md).
|
See [our code of conduct](CODE_OF_CONDUCT.md).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Self-hosted runners [can be configured](https://help.github.com/en/actions/hosti
|
|||||||
|
|
||||||
For actions to **just work** behind a proxy server:
|
For actions to **just work** behind a proxy server:
|
||||||
|
|
||||||
1. Use [tool-cache] version >= 1.3.1
|
1. Use [tool-cache](/packages/tool-cache) version >= 1.3.1
|
||||||
2. Optionally use [actions/http-client](https://github.com/actions/http-client)
|
2. Optionally use [actions/http-client](/packages/http-client)
|
||||||
|
|
||||||
If you are using other http clients, refer to the [environment variables set by the runner](https://help.github.com/en/actions/hosting-your-own-runners/using-a-proxy-server-with-self-hosted-runners).
|
If you are using other http clients, refer to the [environment variables set by the runner](https://help.github.com/en/actions/hosting-your-own-runners/using-a-proxy-server-with-self-hosted-runners).
|
||||||
Generated
+6445
-6670
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -24,7 +24,7 @@
|
|||||||
"eslint-plugin-jest": "^22.21.0",
|
"eslint-plugin-jest": "^22.21.0",
|
||||||
"flow-bin": "^0.115.0",
|
"flow-bin": "^0.115.0",
|
||||||
"jest": "^27.2.5",
|
"jest": "^27.2.5",
|
||||||
"lerna": "^4.0.0",
|
"lerna": "^5.4.0",
|
||||||
"prettier": "^1.19.1",
|
"prettier": "^1.19.1",
|
||||||
"ts-jest": "^27.0.5",
|
"ts-jest": "^27.0.5",
|
||||||
"typescript": "^3.9.9"
|
"typescript": "^3.9.9"
|
||||||
|
|||||||
Generated
+25
-28
@@ -6,10 +6,10 @@
|
|||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/artifact",
|
"name": "@actions/artifact",
|
||||||
"version": "1.0.1",
|
"version": "1.1.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.9.1",
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
"tmp": "^0.2.1",
|
"tmp": "^0.2.1",
|
||||||
"tmp-promise": "^3.0.2"
|
"tmp-promise": "^3.0.2"
|
||||||
@@ -20,19 +20,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
"version": "1.8.0",
|
"version": "1.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
|
||||||
"integrity": "sha512-XirM+Zo/PFlA+1h+i4bkfvagujta+LIM2AOSzPbt8JqXbbuxb1HTB+FqIyaKmue9yiCx/JIJY6pXsOl3+T8JGw==",
|
"integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/http-client": "^1.0.11"
|
"@actions/http-client": "^2.0.1",
|
||||||
}
|
"uuid": "^8.3.2"
|
||||||
},
|
|
||||||
"node_modules/@actions/core/node_modules/@actions/http-client": {
|
|
||||||
"version": "1.0.11",
|
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
|
|
||||||
"integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
|
|
||||||
"dependencies": {
|
|
||||||
"tunnel": "0.0.6"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/http-client": {
|
"node_modules/@actions/http-client": {
|
||||||
@@ -187,6 +180,14 @@
|
|||||||
"node": ">=4.2.0"
|
"node": ">=4.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/uuid": {
|
||||||
|
"version": "8.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||||
|
"bin": {
|
||||||
|
"uuid": "dist/bin/uuid"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/wrappy": {
|
"node_modules/wrappy": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
@@ -195,21 +196,12 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": {
|
"@actions/core": {
|
||||||
"version": "1.8.0",
|
"version": "1.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
|
||||||
"integrity": "sha512-XirM+Zo/PFlA+1h+i4bkfvagujta+LIM2AOSzPbt8JqXbbuxb1HTB+FqIyaKmue9yiCx/JIJY6pXsOl3+T8JGw==",
|
"integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@actions/http-client": "^1.0.11"
|
"@actions/http-client": "^2.0.1",
|
||||||
},
|
"uuid": "^8.3.2"
|
||||||
"dependencies": {
|
|
||||||
"@actions/http-client": {
|
|
||||||
"version": "1.0.11",
|
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
|
|
||||||
"integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
|
|
||||||
"requires": {
|
|
||||||
"tunnel": "0.0.6"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@actions/http-client": {
|
"@actions/http-client": {
|
||||||
@@ -333,6 +325,11 @@
|
|||||||
"integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==",
|
"integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"uuid": {
|
||||||
|
"version": "8.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
|
||||||
|
},
|
||||||
"wrappy": {
|
"wrappy": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
"url": "https://github.com/actions/toolkit/issues"
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.9.1",
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
"tmp": "^0.2.1",
|
"tmp": "^0.2.1",
|
||||||
"tmp-promise": "^3.0.2"
|
"tmp-promise": "^3.0.2"
|
||||||
|
|||||||
Vendored
+6
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
> Functions necessary for caching dependencies and build outputs to improve workflow execution time.
|
> Functions necessary for caching dependencies and build outputs to improve workflow execution time.
|
||||||
|
|
||||||
See ["Caching dependencies to speed up workflows"](https://help.github.com/github/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows) for how caching works.
|
See ["Caching dependencies to speed up workflows"](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows) for how caching works.
|
||||||
|
|
||||||
Note that GitHub will remove any cache entries that have not been accessed in over 7 days. There is no limit on the number of caches you can store, but the total size of all caches in a repository is limited to 10 GB. If you exceed this limit, GitHub will save your cache but will begin evicting caches until the total size is less than 10 GB.
|
Note that GitHub will remove any cache entries that have not been accessed in over 7 days. There is no limit on the number of caches you can store, but the total size of all caches in a repository is limited to 10 GB. If you exceed this limit, GitHub will save your cache but will begin evicting caches until the total size is less than 10 GB.
|
||||||
|
|
||||||
@@ -42,3 +42,8 @@ const restoreKeys = [
|
|||||||
const cacheKey = await cache.restoreCache(paths, key, restoreKeys)
|
const cacheKey = await cache.restoreCache(paths, key, restoreKeys)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
##### Cache segment restore timeout
|
||||||
|
|
||||||
|
A cache gets downloaded in multiple segments of fixed sizes (`1GB` for a `32-bit` runner and `2GB` for a `64-bit` runner). Sometimes, a segment download gets stuck which causes the workflow job to be stuck forever and fail. Version `v3.0.4` of cache package introduces a segment download timeout. The segment download timeout will allow the segment download to get aborted and hence allow the job to proceed with a cache miss.
|
||||||
|
|
||||||
|
Default value of this timeout is 60 minutes and can be customized by specifying an [environment variable](https://docs.github.com/en/actions/learn-github-actions/environment-variables) named `SEGMENT_DOWNLOAD_TIMEOUT_MINS` with timeout value in minutes.
|
||||||
|
|||||||
Vendored
+20
@@ -71,3 +71,23 @@
|
|||||||
|
|
||||||
### 3.0.0
|
### 3.0.0
|
||||||
- Updated actions/cache to suppress Actions cache server error and log warning for those error [#1122](https://github.com/actions/toolkit/pull/1122)
|
- Updated actions/cache to suppress Actions cache server error and log warning for those error [#1122](https://github.com/actions/toolkit/pull/1122)
|
||||||
|
|
||||||
|
### 3.0.1
|
||||||
|
- Fix [#833](https://github.com/actions/cache/issues/833) - cache doesn't work with github workspace directory.
|
||||||
|
- Fix [#809](https://github.com/actions/cache/issues/809) `zstd -d: no such file or directory` error on AWS self-hosted runners.
|
||||||
|
|
||||||
|
### 3.0.2
|
||||||
|
- Added 1 hour timeout for the download stuck issue [#810](https://github.com/actions/cache/issues/810).
|
||||||
|
|
||||||
|
### 3.0.3
|
||||||
|
- Bug fixes for download stuck issue [#810](https://github.com/actions/cache/issues/810).
|
||||||
|
|
||||||
|
### 3.0.4
|
||||||
|
- Fix zstd not working for windows on gnu tar in issues [#888](https://github.com/actions/cache/issues/888) and [#891](https://github.com/actions/cache/issues/891).
|
||||||
|
- Allowing users to provide a custom timeout as input for aborting download of a cache segment using an environment variable `SEGMENT_DOWNLOAD_TIMEOUT_MINS`. Default is 60 minutes.
|
||||||
|
|
||||||
|
### 3.0.5
|
||||||
|
- Update `@actions/cache` to use `@actions/core@^1.10.0`
|
||||||
|
|
||||||
|
### 3.0.6
|
||||||
|
- Added `@azure/abort-controller` to dependencies to fix compatibility issue with ESM [#1208](https://github.com/actions/toolkit/issues/1208)
|
||||||
|
|||||||
+6
@@ -32,3 +32,9 @@ test('assertDefined throws if undefined', () => {
|
|||||||
test('assertDefined returns value', () => {
|
test('assertDefined returns value', () => {
|
||||||
expect(cacheUtils.assertDefined('test', 5)).toBe(5)
|
expect(cacheUtils.assertDefined('test', 5)).toBe(5)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('resolvePaths works on github workspace directory', async () => {
|
||||||
|
const workspace = process.env['GITHUB_WORKSPACE'] ?? '.'
|
||||||
|
const paths = await cacheUtils.resolvePaths([workspace])
|
||||||
|
expect(paths.length).toBeGreaterThan(0)
|
||||||
|
})
|
||||||
|
|||||||
+23
-2
@@ -8,6 +8,7 @@ import {
|
|||||||
const useAzureSdk = true
|
const useAzureSdk = true
|
||||||
const downloadConcurrency = 8
|
const downloadConcurrency = 8
|
||||||
const timeoutInMs = 30000
|
const timeoutInMs = 30000
|
||||||
|
const segmentTimeoutInMs = 3600000
|
||||||
const uploadConcurrency = 4
|
const uploadConcurrency = 4
|
||||||
const uploadChunkSize = 32 * 1024 * 1024
|
const uploadChunkSize = 32 * 1024 * 1024
|
||||||
|
|
||||||
@@ -17,7 +18,8 @@ test('getDownloadOptions sets defaults', async () => {
|
|||||||
expect(actualOptions).toEqual({
|
expect(actualOptions).toEqual({
|
||||||
useAzureSdk,
|
useAzureSdk,
|
||||||
downloadConcurrency,
|
downloadConcurrency,
|
||||||
timeoutInMs
|
timeoutInMs,
|
||||||
|
segmentTimeoutInMs
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -25,7 +27,8 @@ test('getDownloadOptions overrides all settings', async () => {
|
|||||||
const expectedOptions: DownloadOptions = {
|
const expectedOptions: DownloadOptions = {
|
||||||
useAzureSdk: false,
|
useAzureSdk: false,
|
||||||
downloadConcurrency: 14,
|
downloadConcurrency: 14,
|
||||||
timeoutInMs: 20000
|
timeoutInMs: 20000,
|
||||||
|
segmentTimeoutInMs: 3600000
|
||||||
}
|
}
|
||||||
|
|
||||||
const actualOptions = getDownloadOptions(expectedOptions)
|
const actualOptions = getDownloadOptions(expectedOptions)
|
||||||
@@ -52,3 +55,21 @@ test('getUploadOptions overrides all settings', async () => {
|
|||||||
|
|
||||||
expect(actualOptions).toEqual(expectedOptions)
|
expect(actualOptions).toEqual(expectedOptions)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('getDownloadOptions overrides download timeout minutes', async () => {
|
||||||
|
const expectedOptions: DownloadOptions = {
|
||||||
|
useAzureSdk: false,
|
||||||
|
downloadConcurrency: 14,
|
||||||
|
timeoutInMs: 20000,
|
||||||
|
segmentTimeoutInMs: 3600000
|
||||||
|
}
|
||||||
|
process.env.SEGMENT_DOWNLOAD_TIMEOUT_MINS = '10'
|
||||||
|
const actualOptions = getDownloadOptions(expectedOptions)
|
||||||
|
|
||||||
|
expect(actualOptions.useAzureSdk).toEqual(expectedOptions.useAzureSdk)
|
||||||
|
expect(actualOptions.downloadConcurrency).toEqual(
|
||||||
|
expectedOptions.downloadConcurrency
|
||||||
|
)
|
||||||
|
expect(actualOptions.timeoutInMs).toEqual(expectedOptions.timeoutInMs)
|
||||||
|
expect(actualOptions.segmentTimeoutInMs).toEqual(600000)
|
||||||
|
})
|
||||||
|
|||||||
Vendored
+4
-4
@@ -50,7 +50,7 @@ test('zstd extract tar', async () => {
|
|||||||
`"${defaultTarPath}"`,
|
`"${defaultTarPath}"`,
|
||||||
[
|
[
|
||||||
'--use-compress-program',
|
'--use-compress-program',
|
||||||
'zstd -d --long=30',
|
IS_WINDOWS ? 'zstd -d --long=30' : 'unzstd --long=30',
|
||||||
'-xf',
|
'-xf',
|
||||||
IS_WINDOWS ? archivePath.replace(/\\/g, '/') : archivePath,
|
IS_WINDOWS ? archivePath.replace(/\\/g, '/') : archivePath,
|
||||||
'-P',
|
'-P',
|
||||||
@@ -140,7 +140,7 @@ test('zstd create tar', async () => {
|
|||||||
[
|
[
|
||||||
'--posix',
|
'--posix',
|
||||||
'--use-compress-program',
|
'--use-compress-program',
|
||||||
'zstd -T0 --long=30',
|
IS_WINDOWS ? 'zstd -T0 --long=30' : 'zstdmt --long=30',
|
||||||
'-cf',
|
'-cf',
|
||||||
IS_WINDOWS ? CacheFilename.Zstd.replace(/\\/g, '/') : CacheFilename.Zstd,
|
IS_WINDOWS ? CacheFilename.Zstd.replace(/\\/g, '/') : CacheFilename.Zstd,
|
||||||
'--exclude',
|
'--exclude',
|
||||||
@@ -210,7 +210,7 @@ test('zstd list tar', async () => {
|
|||||||
`"${defaultTarPath}"`,
|
`"${defaultTarPath}"`,
|
||||||
[
|
[
|
||||||
'--use-compress-program',
|
'--use-compress-program',
|
||||||
'zstd -d --long=30',
|
IS_WINDOWS ? 'zstd -d --long=30' : 'unzstd --long=30',
|
||||||
'-tf',
|
'-tf',
|
||||||
IS_WINDOWS ? archivePath.replace(/\\/g, '/') : archivePath,
|
IS_WINDOWS ? archivePath.replace(/\\/g, '/') : archivePath,
|
||||||
'-P'
|
'-P'
|
||||||
@@ -235,7 +235,7 @@ test('zstdWithoutLong list tar', async () => {
|
|||||||
`"${defaultTarPath}"`,
|
`"${defaultTarPath}"`,
|
||||||
[
|
[
|
||||||
'--use-compress-program',
|
'--use-compress-program',
|
||||||
'zstd -d',
|
IS_WINDOWS ? 'zstd -d' : 'unzstd',
|
||||||
'-tf',
|
'-tf',
|
||||||
IS_WINDOWS ? archivePath.replace(/\\/g, '/') : archivePath,
|
IS_WINDOWS ? archivePath.replace(/\\/g, '/') : archivePath,
|
||||||
'-P'
|
'-P'
|
||||||
|
|||||||
+42
-18
@@ -1,19 +1,20 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/cache",
|
"name": "@actions/cache",
|
||||||
"version": "3.0.0",
|
"version": "3.0.6",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/cache",
|
"name": "@actions/cache",
|
||||||
"version": "3.0.0",
|
"version": "3.0.6",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.0.1",
|
"@actions/exec": "^1.0.1",
|
||||||
"@actions/glob": "^0.1.0",
|
"@actions/glob": "^0.1.0",
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
"@actions/io": "^1.0.1",
|
"@actions/io": "^1.0.1",
|
||||||
|
"@azure/abort-controller": "^1.1.0",
|
||||||
"@azure/ms-rest-js": "^2.6.0",
|
"@azure/ms-rest-js": "^2.6.0",
|
||||||
"@azure/storage-blob": "^12.8.0",
|
"@azure/storage-blob": "^12.8.0",
|
||||||
"semver": "^6.1.0",
|
"semver": "^6.1.0",
|
||||||
@@ -26,9 +27,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
"version": "1.2.6",
|
"version": "1.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
|
||||||
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA=="
|
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
||||||
|
"dependencies": {
|
||||||
|
"@actions/http-client": "^2.0.1",
|
||||||
|
"uuid": "^8.3.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@actions/core/node_modules/uuid": {
|
||||||
|
"version": "8.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||||
|
"bin": {
|
||||||
|
"uuid": "dist/bin/uuid"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/exec": {
|
"node_modules/@actions/exec": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
@@ -61,14 +74,14 @@
|
|||||||
"integrity": "sha512-d+RwPlMp+2qmBfeLYPLXuSRykDIFEwdTA0MMxzS9kh4kvP1ftrc/9fzy6pX6qAjthdXruHQ6/6kjT/DNo5ALuw=="
|
"integrity": "sha512-d+RwPlMp+2qmBfeLYPLXuSRykDIFEwdTA0MMxzS9kh4kvP1ftrc/9fzy6pX6qAjthdXruHQ6/6kjT/DNo5ALuw=="
|
||||||
},
|
},
|
||||||
"node_modules/@azure/abort-controller": {
|
"node_modules/@azure/abort-controller": {
|
||||||
"version": "1.0.4",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz",
|
||||||
"integrity": "sha512-lNUmDRVGpanCsiUN3NWxFTdwmdFI53xwhkTFfHDGTYk46ca7Ind3nanJc+U6Zj9Tv+9nTCWRBscWEW1DyKOpTw==",
|
"integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tslib": "^2.0.0"
|
"tslib": "^2.2.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8.0.0"
|
"node": ">=12.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@azure/abort-controller/node_modules/tslib": {
|
"node_modules/@azure/abort-controller/node_modules/tslib": {
|
||||||
@@ -605,9 +618,20 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": {
|
"@actions/core": {
|
||||||
"version": "1.2.6",
|
"version": "1.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
|
||||||
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA=="
|
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
||||||
|
"requires": {
|
||||||
|
"@actions/http-client": "^2.0.1",
|
||||||
|
"uuid": "^8.3.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"uuid": {
|
||||||
|
"version": "8.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"@actions/exec": {
|
"@actions/exec": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
@@ -640,11 +664,11 @@
|
|||||||
"integrity": "sha512-d+RwPlMp+2qmBfeLYPLXuSRykDIFEwdTA0MMxzS9kh4kvP1ftrc/9fzy6pX6qAjthdXruHQ6/6kjT/DNo5ALuw=="
|
"integrity": "sha512-d+RwPlMp+2qmBfeLYPLXuSRykDIFEwdTA0MMxzS9kh4kvP1ftrc/9fzy6pX6qAjthdXruHQ6/6kjT/DNo5ALuw=="
|
||||||
},
|
},
|
||||||
"@azure/abort-controller": {
|
"@azure/abort-controller": {
|
||||||
"version": "1.0.4",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz",
|
||||||
"integrity": "sha512-lNUmDRVGpanCsiUN3NWxFTdwmdFI53xwhkTFfHDGTYk46ca7Ind3nanJc+U6Zj9Tv+9nTCWRBscWEW1DyKOpTw==",
|
"integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"tslib": "^2.0.0"
|
"tslib": "^2.2.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tslib": {
|
"tslib": {
|
||||||
|
|||||||
Vendored
+3
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/cache",
|
"name": "@actions/cache",
|
||||||
"version": "3.0.0",
|
"version": "3.0.6",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"description": "Actions cache lib",
|
"description": "Actions cache lib",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -37,11 +37,12 @@
|
|||||||
"url": "https://github.com/actions/toolkit/issues"
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.0.1",
|
"@actions/exec": "^1.0.1",
|
||||||
"@actions/glob": "^0.1.0",
|
"@actions/glob": "^0.1.0",
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
"@actions/io": "^1.0.1",
|
"@actions/io": "^1.0.1",
|
||||||
|
"@azure/abort-controller": "^1.1.0",
|
||||||
"@azure/ms-rest-js": "^2.6.0",
|
"@azure/ms-rest-js": "^2.6.0",
|
||||||
"@azure/storage-blob": "^12.8.0",
|
"@azure/storage-blob": "^12.8.0",
|
||||||
"semver": "^6.1.0",
|
"semver": "^6.1.0",
|
||||||
|
|||||||
+6
-1
@@ -52,7 +52,12 @@ export async function resolvePaths(patterns: string[]): Promise<string[]> {
|
|||||||
.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
|
.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
|
||||||
core.debug(`Matched: ${relativeFile}`)
|
core.debug(`Matched: ${relativeFile}`)
|
||||||
// Paths are made relative so the tar entries are all relative to the root of the workspace.
|
// Paths are made relative so the tar entries are all relative to the root of the workspace.
|
||||||
paths.push(`${relativeFile}`)
|
if (relativeFile === '') {
|
||||||
|
// path.relative returns empty string if workspace and file are equal
|
||||||
|
paths.push('.')
|
||||||
|
} else {
|
||||||
|
paths.push(`${relativeFile}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return paths
|
return paths
|
||||||
|
|||||||
+32
-9
@@ -12,6 +12,8 @@ import {SocketTimeout} from './constants'
|
|||||||
import {DownloadOptions} from '../options'
|
import {DownloadOptions} from '../options'
|
||||||
import {retryHttpClientResponse} from './requestUtils'
|
import {retryHttpClientResponse} from './requestUtils'
|
||||||
|
|
||||||
|
import {AbortController} from '@azure/abort-controller'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pipes the body of a HTTP response to a stream
|
* Pipes the body of a HTTP response to a stream
|
||||||
*
|
*
|
||||||
@@ -247,7 +249,8 @@ export async function downloadCacheStorageSDK(
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
downloadProgress.startDisplayTimer()
|
downloadProgress.startDisplayTimer()
|
||||||
|
const controller = new AbortController()
|
||||||
|
const abortSignal = controller.signal
|
||||||
while (!downloadProgress.isDone()) {
|
while (!downloadProgress.isDone()) {
|
||||||
const segmentStart =
|
const segmentStart =
|
||||||
downloadProgress.segmentOffset + downloadProgress.segmentSize
|
downloadProgress.segmentOffset + downloadProgress.segmentSize
|
||||||
@@ -258,17 +261,22 @@ export async function downloadCacheStorageSDK(
|
|||||||
)
|
)
|
||||||
|
|
||||||
downloadProgress.nextSegment(segmentSize)
|
downloadProgress.nextSegment(segmentSize)
|
||||||
|
const result = await promiseWithTimeout(
|
||||||
const result = await client.downloadToBuffer(
|
options.segmentTimeoutInMs || 3600000,
|
||||||
segmentStart,
|
client.downloadToBuffer(segmentStart, segmentSize, {
|
||||||
segmentSize,
|
abortSignal,
|
||||||
{
|
|
||||||
concurrency: options.downloadConcurrency,
|
concurrency: options.downloadConcurrency,
|
||||||
onProgress: downloadProgress.onProgress()
|
onProgress: downloadProgress.onProgress()
|
||||||
}
|
})
|
||||||
)
|
)
|
||||||
|
if (result === 'timeout') {
|
||||||
fs.writeFileSync(fd, result)
|
controller.abort()
|
||||||
|
throw new Error(
|
||||||
|
'Aborting cache download as the download time exceeded the timeout.'
|
||||||
|
)
|
||||||
|
} else if (Buffer.isBuffer(result)) {
|
||||||
|
fs.writeFileSync(fd, result)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
downloadProgress.stopDisplayTimer()
|
downloadProgress.stopDisplayTimer()
|
||||||
@@ -276,3 +284,18 @@ export async function downloadCacheStorageSDK(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const promiseWithTimeout = async (
|
||||||
|
timeoutMs: number,
|
||||||
|
promise: Promise<Buffer>
|
||||||
|
): Promise<unknown> => {
|
||||||
|
let timeoutHandle: NodeJS.Timeout
|
||||||
|
const timeoutPromise = new Promise(resolve => {
|
||||||
|
timeoutHandle = setTimeout(() => resolve('timeout'), timeoutMs)
|
||||||
|
})
|
||||||
|
|
||||||
|
return Promise.race([promise, timeoutPromise]).then(result => {
|
||||||
|
clearTimeout(timeoutHandle)
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
Vendored
+41
-43
@@ -5,6 +5,8 @@ import * as path from 'path'
|
|||||||
import * as utils from './cacheUtils'
|
import * as utils from './cacheUtils'
|
||||||
import {CompressionMethod} from './constants'
|
import {CompressionMethod} from './constants'
|
||||||
|
|
||||||
|
const IS_WINDOWS = process.platform === 'win32'
|
||||||
|
|
||||||
async function getTarPath(
|
async function getTarPath(
|
||||||
args: string[],
|
args: string[],
|
||||||
compressionMethod: CompressionMethod
|
compressionMethod: CompressionMethod
|
||||||
@@ -54,6 +56,38 @@ function getWorkingDirectory(): string {
|
|||||||
return process.env['GITHUB_WORKSPACE'] ?? process.cwd()
|
return process.env['GITHUB_WORKSPACE'] ?? process.cwd()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Common function for extractTar and listTar to get the compression method
|
||||||
|
function getCompressionProgram(compressionMethod: CompressionMethod): string[] {
|
||||||
|
// -d: Decompress.
|
||||||
|
// unzstd is equivalent to 'zstd -d'
|
||||||
|
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
|
||||||
|
// Using 30 here because we also support 32-bit self-hosted runners.
|
||||||
|
switch (compressionMethod) {
|
||||||
|
case CompressionMethod.Zstd:
|
||||||
|
return [
|
||||||
|
'--use-compress-program',
|
||||||
|
IS_WINDOWS ? 'zstd -d --long=30' : 'unzstd --long=30'
|
||||||
|
]
|
||||||
|
case CompressionMethod.ZstdWithoutLong:
|
||||||
|
return ['--use-compress-program', IS_WINDOWS ? 'zstd -d' : 'unzstd']
|
||||||
|
default:
|
||||||
|
return ['-z']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function listTar(
|
||||||
|
archivePath: string,
|
||||||
|
compressionMethod: CompressionMethod
|
||||||
|
): Promise<void> {
|
||||||
|
const args = [
|
||||||
|
...getCompressionProgram(compressionMethod),
|
||||||
|
'-tf',
|
||||||
|
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
||||||
|
'-P'
|
||||||
|
]
|
||||||
|
await execTar(args, compressionMethod)
|
||||||
|
}
|
||||||
|
|
||||||
export async function extractTar(
|
export async function extractTar(
|
||||||
archivePath: string,
|
archivePath: string,
|
||||||
compressionMethod: CompressionMethod
|
compressionMethod: CompressionMethod
|
||||||
@@ -61,21 +95,8 @@ export async function extractTar(
|
|||||||
// Create directory to extract tar into
|
// Create directory to extract tar into
|
||||||
const workingDirectory = getWorkingDirectory()
|
const workingDirectory = getWorkingDirectory()
|
||||||
await io.mkdirP(workingDirectory)
|
await io.mkdirP(workingDirectory)
|
||||||
// --d: Decompress.
|
|
||||||
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
|
|
||||||
// Using 30 here because we also support 32-bit self-hosted runners.
|
|
||||||
function getCompressionProgram(): string[] {
|
|
||||||
switch (compressionMethod) {
|
|
||||||
case CompressionMethod.Zstd:
|
|
||||||
return ['--use-compress-program', 'zstd -d --long=30']
|
|
||||||
case CompressionMethod.ZstdWithoutLong:
|
|
||||||
return ['--use-compress-program', 'zstd -d']
|
|
||||||
default:
|
|
||||||
return ['-z']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const args = [
|
const args = [
|
||||||
...getCompressionProgram(),
|
...getCompressionProgram(compressionMethod),
|
||||||
'-xf',
|
'-xf',
|
||||||
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
||||||
'-P',
|
'-P',
|
||||||
@@ -100,15 +121,19 @@ export async function createTar(
|
|||||||
const workingDirectory = getWorkingDirectory()
|
const workingDirectory = getWorkingDirectory()
|
||||||
|
|
||||||
// -T#: Compress using # working thread. If # is 0, attempt to detect and use the number of physical CPU cores.
|
// -T#: Compress using # working thread. If # is 0, attempt to detect and use the number of physical CPU cores.
|
||||||
|
// zstdmt is equivalent to 'zstd -T0'
|
||||||
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
|
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
|
||||||
// Using 30 here because we also support 32-bit self-hosted runners.
|
// Using 30 here because we also support 32-bit self-hosted runners.
|
||||||
// Long range mode is added to zstd in v1.3.2 release, so we will not use --long in older version of zstd.
|
// Long range mode is added to zstd in v1.3.2 release, so we will not use --long in older version of zstd.
|
||||||
function getCompressionProgram(): string[] {
|
function getCompressionProgram(): string[] {
|
||||||
switch (compressionMethod) {
|
switch (compressionMethod) {
|
||||||
case CompressionMethod.Zstd:
|
case CompressionMethod.Zstd:
|
||||||
return ['--use-compress-program', 'zstd -T0 --long=30']
|
return [
|
||||||
|
'--use-compress-program',
|
||||||
|
IS_WINDOWS ? 'zstd -T0 --long=30' : 'zstdmt --long=30'
|
||||||
|
]
|
||||||
case CompressionMethod.ZstdWithoutLong:
|
case CompressionMethod.ZstdWithoutLong:
|
||||||
return ['--use-compress-program', 'zstd -T0']
|
return ['--use-compress-program', IS_WINDOWS ? 'zstd -T0' : 'zstdmt']
|
||||||
default:
|
default:
|
||||||
return ['-z']
|
return ['-z']
|
||||||
}
|
}
|
||||||
@@ -128,30 +153,3 @@ export async function createTar(
|
|||||||
]
|
]
|
||||||
await execTar(args, compressionMethod, archiveFolder)
|
await execTar(args, compressionMethod, archiveFolder)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function listTar(
|
|
||||||
archivePath: string,
|
|
||||||
compressionMethod: CompressionMethod
|
|
||||||
): Promise<void> {
|
|
||||||
// --d: Decompress.
|
|
||||||
// --long=#: Enables long distance matching with # bits.
|
|
||||||
// Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
|
|
||||||
// Using 30 here because we also support 32-bit self-hosted runners.
|
|
||||||
function getCompressionProgram(): string[] {
|
|
||||||
switch (compressionMethod) {
|
|
||||||
case CompressionMethod.Zstd:
|
|
||||||
return ['--use-compress-program', 'zstd -d --long=30']
|
|
||||||
case CompressionMethod.ZstdWithoutLong:
|
|
||||||
return ['--use-compress-program', 'zstd -d']
|
|
||||||
default:
|
|
||||||
return ['-z']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const args = [
|
|
||||||
...getCompressionProgram(),
|
|
||||||
'-tf',
|
|
||||||
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
|
||||||
'-P'
|
|
||||||
]
|
|
||||||
await execTar(args, compressionMethod)
|
|
||||||
}
|
|
||||||
|
|||||||
Vendored
+27
-2
@@ -46,6 +46,13 @@ export interface DownloadOptions {
|
|||||||
* @default 30000
|
* @default 30000
|
||||||
*/
|
*/
|
||||||
timeoutInMs?: number
|
timeoutInMs?: number
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Time after which a segment download should be aborted if stuck
|
||||||
|
*
|
||||||
|
* @default 3600000
|
||||||
|
*/
|
||||||
|
segmentTimeoutInMs?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,7 +91,8 @@ export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions {
|
|||||||
const result: DownloadOptions = {
|
const result: DownloadOptions = {
|
||||||
useAzureSdk: true,
|
useAzureSdk: true,
|
||||||
downloadConcurrency: 8,
|
downloadConcurrency: 8,
|
||||||
timeoutInMs: 30000
|
timeoutInMs: 30000,
|
||||||
|
segmentTimeoutInMs: 3600000
|
||||||
}
|
}
|
||||||
|
|
||||||
if (copy) {
|
if (copy) {
|
||||||
@@ -99,11 +107,28 @@ export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions {
|
|||||||
if (typeof copy.timeoutInMs === 'number') {
|
if (typeof copy.timeoutInMs === 'number') {
|
||||||
result.timeoutInMs = copy.timeoutInMs
|
result.timeoutInMs = copy.timeoutInMs
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
if (typeof copy.segmentTimeoutInMs === 'number') {
|
||||||
|
result.segmentTimeoutInMs = copy.segmentTimeoutInMs
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const segmentDownloadTimeoutMins =
|
||||||
|
process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']
|
||||||
|
|
||||||
|
if (
|
||||||
|
segmentDownloadTimeoutMins &&
|
||||||
|
!isNaN(Number(segmentDownloadTimeoutMins)) &&
|
||||||
|
isFinite(Number(segmentDownloadTimeoutMins))
|
||||||
|
) {
|
||||||
|
result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1000
|
||||||
|
}
|
||||||
core.debug(`Use Azure SDK: ${result.useAzureSdk}`)
|
core.debug(`Use Azure SDK: ${result.useAzureSdk}`)
|
||||||
core.debug(`Download concurrency: ${result.downloadConcurrency}`)
|
core.debug(`Download concurrency: ${result.downloadConcurrency}`)
|
||||||
core.debug(`Request timeout (ms): ${result.timeoutInMs}`)
|
core.debug(`Request timeout (ms): ${result.timeoutInMs}`)
|
||||||
|
core.debug(
|
||||||
|
`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`
|
||||||
|
)
|
||||||
|
core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ export interface AnnotationProperties {
|
|||||||
startColumn?: number
|
startColumn?: number
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The start column for the annotation. Cannot be sent when `startLine` and `endLine` are different values.
|
* The end column for the annotation. Cannot be sent when `startLine` and `endLine` are different values.
|
||||||
* Defaults to `startColumn` when `startColumn` is provided.
|
* Defaults to `startColumn` when `startColumn` is provided.
|
||||||
*/
|
*/
|
||||||
endColumn?: number
|
endColumn?: number
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
# @actions/core Releases
|
# @actions/core Releases
|
||||||
|
|
||||||
|
### 1.10.0
|
||||||
|
- `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)
|
||||||
|
|
||||||
|
### 1.9.1
|
||||||
|
- Randomize delimiter when calling `core.exportVariable`
|
||||||
|
|
||||||
### 1.9.0
|
### 1.9.0
|
||||||
- Added `toPosixPath`, `toWin32Path` and `toPlatformPath` utilities [#1102](https://github.com/actions/toolkit/pull/1102)
|
- Added `toPosixPath`, `toWin32Path` and `toPlatformPath` utilities [#1102](https://github.com/actions/toolkit/pull/1102)
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import * as path from 'path'
|
|||||||
import * as core from '../src/core'
|
import * as core from '../src/core'
|
||||||
import {HttpClient} from '@actions/http-client'
|
import {HttpClient} from '@actions/http-client'
|
||||||
import {toCommandProperties} from '../src/utils'
|
import {toCommandProperties} from '../src/utils'
|
||||||
|
import * as uuid from 'uuid'
|
||||||
|
|
||||||
|
jest.mock('uuid')
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/unbound-method */
|
/* eslint-disable @typescript-eslint/unbound-method */
|
||||||
|
|
||||||
@@ -30,17 +33,22 @@ const testEnvVars = {
|
|||||||
INPUT_BOOLEAN_INPUT_FALSE3: 'FALSE',
|
INPUT_BOOLEAN_INPUT_FALSE3: 'FALSE',
|
||||||
INPUT_WRONG_BOOLEAN_INPUT: 'wrong',
|
INPUT_WRONG_BOOLEAN_INPUT: 'wrong',
|
||||||
INPUT_WITH_TRAILING_WHITESPACE: ' some val ',
|
INPUT_WITH_TRAILING_WHITESPACE: ' some val ',
|
||||||
|
|
||||||
INPUT_MY_INPUT_LIST: 'val1\nval2\nval3',
|
INPUT_MY_INPUT_LIST: 'val1\nval2\nval3',
|
||||||
|
INPUT_LIST_WITH_TRAILING_WHITESPACE: ' val1 \n val2 \n ',
|
||||||
|
|
||||||
// Save inputs
|
// Save inputs
|
||||||
STATE_TEST_1: 'state_val',
|
STATE_TEST_1: 'state_val',
|
||||||
|
|
||||||
// File Commands
|
// File Commands
|
||||||
GITHUB_PATH: '',
|
GITHUB_PATH: '',
|
||||||
GITHUB_ENV: ''
|
GITHUB_ENV: '',
|
||||||
|
GITHUB_OUTPUT: '',
|
||||||
|
GITHUB_STATE: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const UUID = '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'
|
||||||
|
const DELIMITER = `ghadelimiter_${UUID}`
|
||||||
|
|
||||||
describe('@actions/core', () => {
|
describe('@actions/core', () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
const filePath = path.join(__dirname, `test`)
|
const filePath = path.join(__dirname, `test`)
|
||||||
@@ -54,6 +62,14 @@ describe('@actions/core', () => {
|
|||||||
process.env[key] = testEnvVars[key as keyof typeof testEnvVars]
|
process.env[key] = testEnvVars[key as keyof typeof testEnvVars]
|
||||||
}
|
}
|
||||||
process.stdout.write = jest.fn()
|
process.stdout.write = jest.fn()
|
||||||
|
|
||||||
|
jest.spyOn(uuid, 'v4').mockImplementation(() => {
|
||||||
|
return UUID
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
jest.restoreAllMocks()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('legacy exportVariable produces the correct command and sets the env', () => {
|
it('legacy exportVariable produces the correct command and sets the env', () => {
|
||||||
@@ -91,7 +107,7 @@ describe('@actions/core', () => {
|
|||||||
core.exportVariable('my var', 'var val')
|
core.exportVariable('my var', 'var val')
|
||||||
verifyFileCommand(
|
verifyFileCommand(
|
||||||
command,
|
command,
|
||||||
`my var<<_GitHubActionsFileCommandDelimeter_${os.EOL}var val${os.EOL}_GitHubActionsFileCommandDelimeter_${os.EOL}`
|
`my var<<${DELIMITER}${os.EOL}var val${os.EOL}${DELIMITER}${os.EOL}`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -101,7 +117,7 @@ describe('@actions/core', () => {
|
|||||||
core.exportVariable('my var', true)
|
core.exportVariable('my var', true)
|
||||||
verifyFileCommand(
|
verifyFileCommand(
|
||||||
command,
|
command,
|
||||||
`my var<<_GitHubActionsFileCommandDelimeter_${os.EOL}true${os.EOL}_GitHubActionsFileCommandDelimeter_${os.EOL}`
|
`my var<<${DELIMITER}${os.EOL}true${os.EOL}${DELIMITER}${os.EOL}`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -111,10 +127,38 @@ describe('@actions/core', () => {
|
|||||||
core.exportVariable('my var', 5)
|
core.exportVariable('my var', 5)
|
||||||
verifyFileCommand(
|
verifyFileCommand(
|
||||||
command,
|
command,
|
||||||
`my var<<_GitHubActionsFileCommandDelimeter_${os.EOL}5${os.EOL}_GitHubActionsFileCommandDelimeter_${os.EOL}`
|
`my var<<${DELIMITER}${os.EOL}5${os.EOL}${DELIMITER}${os.EOL}`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('exportVariable does not allow delimiter as value', () => {
|
||||||
|
const command = 'ENV'
|
||||||
|
createFileCommandFile(command)
|
||||||
|
|
||||||
|
expect(() => {
|
||||||
|
core.exportVariable('my var', `good stuff ${DELIMITER} bad stuff`)
|
||||||
|
}).toThrow(
|
||||||
|
`Unexpected input: value should not contain the delimiter "${DELIMITER}"`
|
||||||
|
)
|
||||||
|
|
||||||
|
const filePath = path.join(__dirname, `test/${command}`)
|
||||||
|
fs.unlinkSync(filePath)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('exportVariable does not allow delimiter as name', () => {
|
||||||
|
const command = 'ENV'
|
||||||
|
createFileCommandFile(command)
|
||||||
|
|
||||||
|
expect(() => {
|
||||||
|
core.exportVariable(`good stuff ${DELIMITER} bad stuff`, 'test')
|
||||||
|
}).toThrow(
|
||||||
|
`Unexpected input: name should not contain the delimiter "${DELIMITER}"`
|
||||||
|
)
|
||||||
|
|
||||||
|
const filePath = path.join(__dirname, `test/${command}`)
|
||||||
|
fs.unlinkSync(filePath)
|
||||||
|
})
|
||||||
|
|
||||||
it('setSecret produces the correct command', () => {
|
it('setSecret produces the correct command', () => {
|
||||||
core.setSecret('secret val')
|
core.setSecret('secret val')
|
||||||
assertWriteCalls([`::add-mask::secret val${os.EOL}`])
|
assertWriteCalls([`::add-mask::secret val${os.EOL}`])
|
||||||
@@ -170,14 +214,6 @@ describe('@actions/core', () => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('getMultilineInput works', () => {
|
|
||||||
expect(core.getMultilineInput('my input list')).toEqual([
|
|
||||||
'val1',
|
|
||||||
'val2',
|
|
||||||
'val3'
|
|
||||||
])
|
|
||||||
})
|
|
||||||
|
|
||||||
it('getInput trims whitespace by default', () => {
|
it('getInput trims whitespace by default', () => {
|
||||||
expect(core.getInput('with trailing whitespace')).toBe('some val')
|
expect(core.getInput('with trailing whitespace')).toBe('some val')
|
||||||
})
|
})
|
||||||
@@ -218,7 +254,38 @@ describe('@actions/core', () => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('setOutput produces the correct command', () => {
|
it('getMultilineInput works', () => {
|
||||||
|
expect(core.getMultilineInput('my input list')).toEqual([
|
||||||
|
'val1',
|
||||||
|
'val2',
|
||||||
|
'val3'
|
||||||
|
])
|
||||||
|
})
|
||||||
|
|
||||||
|
it('getMultilineInput trims whitespace by default', () => {
|
||||||
|
expect(core.getMultilineInput('list with trailing whitespace')).toEqual([
|
||||||
|
'val1',
|
||||||
|
'val2'
|
||||||
|
])
|
||||||
|
})
|
||||||
|
|
||||||
|
it('getMultilineInput trims whitespace when option is explicitly true', () => {
|
||||||
|
expect(
|
||||||
|
core.getMultilineInput('list with trailing whitespace', {
|
||||||
|
trimWhitespace: true
|
||||||
|
})
|
||||||
|
).toEqual(['val1', 'val2'])
|
||||||
|
})
|
||||||
|
|
||||||
|
it('getMultilineInput does not trim whitespace when option is false', () => {
|
||||||
|
expect(
|
||||||
|
core.getMultilineInput('list with trailing whitespace', {
|
||||||
|
trimWhitespace: false
|
||||||
|
})
|
||||||
|
).toEqual([' val1 ', ' val2 ', ' '])
|
||||||
|
})
|
||||||
|
|
||||||
|
it('legacy setOutput produces the correct command', () => {
|
||||||
core.setOutput('some output', 'some value')
|
core.setOutput('some output', 'some value')
|
||||||
assertWriteCalls([
|
assertWriteCalls([
|
||||||
os.EOL,
|
os.EOL,
|
||||||
@@ -226,16 +293,74 @@ describe('@actions/core', () => {
|
|||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
it('setOutput handles bools', () => {
|
it('legacy setOutput handles bools', () => {
|
||||||
core.setOutput('some output', false)
|
core.setOutput('some output', false)
|
||||||
assertWriteCalls([os.EOL, `::set-output name=some output::false${os.EOL}`])
|
assertWriteCalls([os.EOL, `::set-output name=some output::false${os.EOL}`])
|
||||||
})
|
})
|
||||||
|
|
||||||
it('setOutput handles numbers', () => {
|
it('legacy setOutput handles numbers', () => {
|
||||||
core.setOutput('some output', 1.01)
|
core.setOutput('some output', 1.01)
|
||||||
assertWriteCalls([os.EOL, `::set-output name=some output::1.01${os.EOL}`])
|
assertWriteCalls([os.EOL, `::set-output name=some output::1.01${os.EOL}`])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('setOutput produces the correct command and sets the output', () => {
|
||||||
|
const command = 'OUTPUT'
|
||||||
|
createFileCommandFile(command)
|
||||||
|
core.setOutput('my out', 'out val')
|
||||||
|
verifyFileCommand(
|
||||||
|
command,
|
||||||
|
`my out<<${DELIMITER}${os.EOL}out val${os.EOL}${DELIMITER}${os.EOL}`
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('setOutput handles boolean inputs', () => {
|
||||||
|
const command = 'OUTPUT'
|
||||||
|
createFileCommandFile(command)
|
||||||
|
core.setOutput('my out', true)
|
||||||
|
verifyFileCommand(
|
||||||
|
command,
|
||||||
|
`my out<<${DELIMITER}${os.EOL}true${os.EOL}${DELIMITER}${os.EOL}`
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('setOutput handles number inputs', () => {
|
||||||
|
const command = 'OUTPUT'
|
||||||
|
createFileCommandFile(command)
|
||||||
|
core.setOutput('my out', 5)
|
||||||
|
verifyFileCommand(
|
||||||
|
command,
|
||||||
|
`my out<<${DELIMITER}${os.EOL}5${os.EOL}${DELIMITER}${os.EOL}`
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('setOutput does not allow delimiter as value', () => {
|
||||||
|
const command = 'OUTPUT'
|
||||||
|
createFileCommandFile(command)
|
||||||
|
|
||||||
|
expect(() => {
|
||||||
|
core.setOutput('my out', `good stuff ${DELIMITER} bad stuff`)
|
||||||
|
}).toThrow(
|
||||||
|
`Unexpected input: value should not contain the delimiter "${DELIMITER}"`
|
||||||
|
)
|
||||||
|
|
||||||
|
const filePath = path.join(__dirname, `test/${command}`)
|
||||||
|
fs.unlinkSync(filePath)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('setOutput does not allow delimiter as name', () => {
|
||||||
|
const command = 'OUTPUT'
|
||||||
|
createFileCommandFile(command)
|
||||||
|
|
||||||
|
expect(() => {
|
||||||
|
core.setOutput(`good stuff ${DELIMITER} bad stuff`, 'test')
|
||||||
|
}).toThrow(
|
||||||
|
`Unexpected input: name should not contain the delimiter "${DELIMITER}"`
|
||||||
|
)
|
||||||
|
|
||||||
|
const filePath = path.join(__dirname, `test/${command}`)
|
||||||
|
fs.unlinkSync(filePath)
|
||||||
|
})
|
||||||
|
|
||||||
it('setFailed sets the correct exit code and failure message', () => {
|
it('setFailed sets the correct exit code and failure message', () => {
|
||||||
core.setFailed('Failure message')
|
core.setFailed('Failure message')
|
||||||
expect(process.exitCode).toBe(core.ExitCode.Failure)
|
expect(process.exitCode).toBe(core.ExitCode.Failure)
|
||||||
@@ -401,21 +526,79 @@ describe('@actions/core', () => {
|
|||||||
assertWriteCalls([`::debug::%0D%0Adebug%0A${os.EOL}`])
|
assertWriteCalls([`::debug::%0D%0Adebug%0A${os.EOL}`])
|
||||||
})
|
})
|
||||||
|
|
||||||
it('saveState produces the correct command', () => {
|
it('legacy saveState produces the correct command', () => {
|
||||||
core.saveState('state_1', 'some value')
|
core.saveState('state_1', 'some value')
|
||||||
assertWriteCalls([`::save-state name=state_1::some value${os.EOL}`])
|
assertWriteCalls([`::save-state name=state_1::some value${os.EOL}`])
|
||||||
})
|
})
|
||||||
|
|
||||||
it('saveState handles numbers', () => {
|
it('legacy saveState handles numbers', () => {
|
||||||
core.saveState('state_1', 1)
|
core.saveState('state_1', 1)
|
||||||
assertWriteCalls([`::save-state name=state_1::1${os.EOL}`])
|
assertWriteCalls([`::save-state name=state_1::1${os.EOL}`])
|
||||||
})
|
})
|
||||||
|
|
||||||
it('saveState handles bools', () => {
|
it('legacy saveState handles bools', () => {
|
||||||
core.saveState('state_1', true)
|
core.saveState('state_1', true)
|
||||||
assertWriteCalls([`::save-state name=state_1::true${os.EOL}`])
|
assertWriteCalls([`::save-state name=state_1::true${os.EOL}`])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('saveState produces the correct command and saves the state', () => {
|
||||||
|
const command = 'STATE'
|
||||||
|
createFileCommandFile(command)
|
||||||
|
core.saveState('my state', 'out val')
|
||||||
|
verifyFileCommand(
|
||||||
|
command,
|
||||||
|
`my state<<${DELIMITER}${os.EOL}out val${os.EOL}${DELIMITER}${os.EOL}`
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('saveState handles boolean inputs', () => {
|
||||||
|
const command = 'STATE'
|
||||||
|
createFileCommandFile(command)
|
||||||
|
core.saveState('my state', true)
|
||||||
|
verifyFileCommand(
|
||||||
|
command,
|
||||||
|
`my state<<${DELIMITER}${os.EOL}true${os.EOL}${DELIMITER}${os.EOL}`
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('saveState handles number inputs', () => {
|
||||||
|
const command = 'STATE'
|
||||||
|
createFileCommandFile(command)
|
||||||
|
core.saveState('my state', 5)
|
||||||
|
verifyFileCommand(
|
||||||
|
command,
|
||||||
|
`my state<<${DELIMITER}${os.EOL}5${os.EOL}${DELIMITER}${os.EOL}`
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('saveState does not allow delimiter as value', () => {
|
||||||
|
const command = 'STATE'
|
||||||
|
createFileCommandFile(command)
|
||||||
|
|
||||||
|
expect(() => {
|
||||||
|
core.saveState('my state', `good stuff ${DELIMITER} bad stuff`)
|
||||||
|
}).toThrow(
|
||||||
|
`Unexpected input: value should not contain the delimiter "${DELIMITER}"`
|
||||||
|
)
|
||||||
|
|
||||||
|
const filePath = path.join(__dirname, `test/${command}`)
|
||||||
|
fs.unlinkSync(filePath)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('saveState does not allow delimiter as name', () => {
|
||||||
|
const command = 'STATE'
|
||||||
|
createFileCommandFile(command)
|
||||||
|
|
||||||
|
expect(() => {
|
||||||
|
core.saveState(`good stuff ${DELIMITER} bad stuff`, 'test')
|
||||||
|
}).toThrow(
|
||||||
|
`Unexpected input: name should not contain the delimiter "${DELIMITER}"`
|
||||||
|
)
|
||||||
|
|
||||||
|
const filePath = path.join(__dirname, `test/${command}`)
|
||||||
|
fs.unlinkSync(filePath)
|
||||||
|
})
|
||||||
|
|
||||||
it('getState gets wrapper action state', () => {
|
it('getState gets wrapper action state', () => {
|
||||||
expect(core.getState('TEST_1')).toBe('state_val')
|
expect(core.getState('TEST_1')).toBe('state_val')
|
||||||
})
|
})
|
||||||
|
|||||||
Generated
+31
-4
@@ -1,18 +1,20 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/core",
|
"name": "@actions/core",
|
||||||
"version": "1.9.0",
|
"version": "1.10.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/core",
|
"name": "@actions/core",
|
||||||
"version": "1.8.1",
|
"version": "1.10.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/http-client": "^2.0.1"
|
"@actions/http-client": "^2.0.1",
|
||||||
|
"uuid": "^8.3.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^12.0.2"
|
"@types/node": "^12.0.2",
|
||||||
|
"@types/uuid": "^8.3.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/http-client": {
|
"node_modules/@actions/http-client": {
|
||||||
@@ -29,6 +31,12 @@
|
|||||||
"integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==",
|
"integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/uuid": {
|
||||||
|
"version": "8.3.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz",
|
||||||
|
"integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/tunnel": {
|
"node_modules/tunnel": {
|
||||||
"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",
|
||||||
@@ -36,6 +44,14 @@
|
|||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"node_modules/uuid": {
|
||||||
|
"version": "8.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||||
|
"bin": {
|
||||||
|
"uuid": "dist/bin/uuid"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -53,10 +69,21 @@
|
|||||||
"integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==",
|
"integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"@types/uuid": {
|
||||||
|
"version": "8.3.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz",
|
||||||
|
"integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"tunnel": {
|
"tunnel": {
|
||||||
"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=="
|
||||||
|
},
|
||||||
|
"uuid": {
|
||||||
|
"version": "8.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/core",
|
"name": "@actions/core",
|
||||||
"version": "1.9.0",
|
"version": "1.10.0",
|
||||||
"description": "Actions core lib",
|
"description": "Actions core lib",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"github",
|
"github",
|
||||||
@@ -36,9 +36,11 @@
|
|||||||
"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": "^2.0.1",
|
||||||
|
"uuid": "^8.3.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^12.0.2"
|
"@types/node": "^12.0.2",
|
||||||
|
"@types/uuid": "^8.3.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-10
@@ -1,5 +1,5 @@
|
|||||||
import {issue, issueCommand} from './command'
|
import {issue, issueCommand} from './command'
|
||||||
import {issueCommand as issueFileCommand} from './file-command'
|
import {issueFileCommand, prepareKeyValueMessage} from './file-command'
|
||||||
import {toCommandProperties, toCommandValue} from './utils'
|
import {toCommandProperties, toCommandValue} from './utils'
|
||||||
|
|
||||||
import * as os from 'os'
|
import * as os from 'os'
|
||||||
@@ -64,7 +64,7 @@ export interface AnnotationProperties {
|
|||||||
startColumn?: number
|
startColumn?: number
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The start column for the annotation. Cannot be sent when `startLine` and `endLine` are different values.
|
* The end column for the annotation. Cannot be sent when `startLine` and `endLine` are different values.
|
||||||
* Defaults to `startColumn` when `startColumn` is provided.
|
* Defaults to `startColumn` when `startColumn` is provided.
|
||||||
*/
|
*/
|
||||||
endColumn?: number
|
endColumn?: number
|
||||||
@@ -86,12 +86,10 @@ export function exportVariable(name: string, val: any): void {
|
|||||||
|
|
||||||
const filePath = process.env['GITHUB_ENV'] || ''
|
const filePath = process.env['GITHUB_ENV'] || ''
|
||||||
if (filePath) {
|
if (filePath) {
|
||||||
const delimiter = '_GitHubActionsFileCommandDelimeter_'
|
return issueFileCommand('ENV', prepareKeyValueMessage(name, val))
|
||||||
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`
|
|
||||||
issueFileCommand('ENV', commandValue)
|
|
||||||
} else {
|
|
||||||
issueCommand('set-env', {name}, convertedVal)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issueCommand('set-env', {name}, convertedVal)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -155,7 +153,11 @@ export function getMultilineInput(
|
|||||||
.split('\n')
|
.split('\n')
|
||||||
.filter(x => x !== '')
|
.filter(x => x !== '')
|
||||||
|
|
||||||
return inputs
|
if (options && options.trimWhitespace === false) {
|
||||||
|
return inputs
|
||||||
|
}
|
||||||
|
|
||||||
|
return inputs.map(input => input.trim())
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -188,8 +190,13 @@ export function getBooleanInput(name: string, options?: InputOptions): boolean {
|
|||||||
*/
|
*/
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
export function setOutput(name: string, value: any): void {
|
export function setOutput(name: string, value: any): void {
|
||||||
|
const filePath = process.env['GITHUB_OUTPUT'] || ''
|
||||||
|
if (filePath) {
|
||||||
|
return issueFileCommand('OUTPUT', prepareKeyValueMessage(name, value))
|
||||||
|
}
|
||||||
|
|
||||||
process.stdout.write(os.EOL)
|
process.stdout.write(os.EOL)
|
||||||
issueCommand('set-output', {name}, value)
|
issueCommand('set-output', {name}, toCommandValue(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -343,7 +350,12 @@ export async function group<T>(name: string, fn: () => Promise<T>): Promise<T> {
|
|||||||
*/
|
*/
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
export function saveState(name: string, value: any): void {
|
export function saveState(name: string, value: any): void {
|
||||||
issueCommand('save-state', {name}, value)
|
const filePath = process.env['GITHUB_STATE'] || ''
|
||||||
|
if (filePath) {
|
||||||
|
return issueFileCommand('STATE', prepareKeyValueMessage(name, value))
|
||||||
|
}
|
||||||
|
|
||||||
|
issueCommand('save-state', {name}, toCommandValue(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,9 +5,10 @@
|
|||||||
|
|
||||||
import * as fs from 'fs'
|
import * as fs from 'fs'
|
||||||
import * as os from 'os'
|
import * as os from 'os'
|
||||||
|
import {v4 as uuidv4} from 'uuid'
|
||||||
import {toCommandValue} from './utils'
|
import {toCommandValue} from './utils'
|
||||||
|
|
||||||
export function issueCommand(command: string, message: any): void {
|
export function issueFileCommand(command: string, message: any): void {
|
||||||
const filePath = process.env[`GITHUB_${command}`]
|
const filePath = process.env[`GITHUB_${command}`]
|
||||||
if (!filePath) {
|
if (!filePath) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
@@ -22,3 +23,25 @@ export function issueCommand(command: string, message: any): void {
|
|||||||
encoding: 'utf8'
|
encoding: 'utf8'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function prepareKeyValueMessage(key: string, value: any): string {
|
||||||
|
const delimiter = `ghadelimiter_${uuidv4()}`
|
||||||
|
const convertedValue = toCommandValue(value)
|
||||||
|
|
||||||
|
// These should realistically never happen, but just in case someone finds a
|
||||||
|
// way to exploit uuid generation let's not allow keys or values that contain
|
||||||
|
// the delimiter.
|
||||||
|
if (key.includes(delimiter)) {
|
||||||
|
throw new Error(
|
||||||
|
`Unexpected input: name should not contain the delimiter "${delimiter}"`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (convertedValue.includes(delimiter)) {
|
||||||
|
throw new Error(
|
||||||
|
`Unexpected input: value should not contain the delimiter "${delimiter}"`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
# @actions/github Releases
|
# @actions/github Releases
|
||||||
|
|
||||||
|
### 5.1.1
|
||||||
|
- Export default octokit options [#1188](https://github.com/actions/toolkit/pull/1188)
|
||||||
|
|
||||||
|
### 5.1.0
|
||||||
|
- Add additionalPlugins parameter to getOctokit method [#1181](https://github.com/actions/toolkit/pull/1181)
|
||||||
|
- Dependency updates [#1180](https://github.com/actions/toolkit/pull/1180)
|
||||||
|
|
||||||
|
|
||||||
### 5.0.3
|
### 5.0.3
|
||||||
- - Update to v2.0.1 of `@actions/http-client` [#1087](https://github.com/actions/toolkit/pull/1087)
|
- - Update to v2.0.1 of `@actions/http-client` [#1087](https://github.com/actions/toolkit/pull/1087)
|
||||||
|
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/github",
|
"name": "@actions/github",
|
||||||
"version": "5.0.3",
|
"version": "5.1.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/github",
|
"name": "@actions/github",
|
||||||
"version": "5.0.2",
|
"version": "5.1.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/github",
|
"name": "@actions/github",
|
||||||
"version": "5.0.3",
|
"version": "5.1.1",
|
||||||
"description": "Actions github lib",
|
"description": "Actions github lib",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"github",
|
"github",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import * as Context from './context'
|
|||||||
import {GitHub, getOctokitOptions} from './utils'
|
import {GitHub, getOctokitOptions} from './utils'
|
||||||
|
|
||||||
// octokit + plugins
|
// octokit + plugins
|
||||||
import {OctokitOptions} from '@octokit/core/dist-types/types'
|
import {OctokitOptions, OctokitPlugin} from '@octokit/core/dist-types/types'
|
||||||
|
|
||||||
export const context = new Context.Context()
|
export const context = new Context.Context()
|
||||||
|
|
||||||
@@ -14,7 +14,9 @@ export const context = new Context.Context()
|
|||||||
*/
|
*/
|
||||||
export function getOctokit(
|
export function getOctokit(
|
||||||
token: string,
|
token: string,
|
||||||
options?: OctokitOptions
|
options?: OctokitOptions,
|
||||||
|
...additionalPlugins: OctokitPlugin[]
|
||||||
): InstanceType<typeof GitHub> {
|
): InstanceType<typeof GitHub> {
|
||||||
return new GitHub(getOctokitOptions(token, options))
|
const GitHubWithPlugins = GitHub.plugin(...additionalPlugins)
|
||||||
|
return new GitHubWithPlugins(getOctokitOptions(token, options))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {paginateRest} from '@octokit/plugin-paginate-rest'
|
|||||||
export const context = new Context.Context()
|
export const context = new Context.Context()
|
||||||
|
|
||||||
const baseUrl = Utils.getApiBaseUrl()
|
const baseUrl = Utils.getApiBaseUrl()
|
||||||
const defaults = {
|
export const defaults: OctokitOptions = {
|
||||||
baseUrl,
|
baseUrl,
|
||||||
request: {
|
request: {
|
||||||
agent: Utils.getProxyAgent(baseUrl)
|
agent: Utils.getProxyAgent(baseUrl)
|
||||||
|
|||||||
Generated
+32
-17
@@ -9,24 +9,25 @@
|
|||||||
"version": "0.3.0",
|
"version": "0.3.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.9.1",
|
||||||
"minimatch": "^3.0.4"
|
"minimatch": "^3.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
"version": "1.8.0",
|
"version": "1.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
|
||||||
"integrity": "sha512-XirM+Zo/PFlA+1h+i4bkfvagujta+LIM2AOSzPbt8JqXbbuxb1HTB+FqIyaKmue9yiCx/JIJY6pXsOl3+T8JGw==",
|
"integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/http-client": "^1.0.11"
|
"@actions/http-client": "^2.0.1",
|
||||||
|
"uuid": "^8.3.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/http-client": {
|
"node_modules/@actions/http-client": {
|
||||||
"version": "1.0.11",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
|
||||||
"integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
|
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tunnel": "0.0.6"
|
"tunnel": "^0.0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/balanced-match": {
|
"node_modules/balanced-match": {
|
||||||
@@ -66,23 +67,32 @@
|
|||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"node_modules/uuid": {
|
||||||
|
"version": "8.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||||
|
"bin": {
|
||||||
|
"uuid": "dist/bin/uuid"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": {
|
"@actions/core": {
|
||||||
"version": "1.8.0",
|
"version": "1.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
|
||||||
"integrity": "sha512-XirM+Zo/PFlA+1h+i4bkfvagujta+LIM2AOSzPbt8JqXbbuxb1HTB+FqIyaKmue9yiCx/JIJY6pXsOl3+T8JGw==",
|
"integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@actions/http-client": "^1.0.11"
|
"@actions/http-client": "^2.0.1",
|
||||||
|
"uuid": "^8.3.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@actions/http-client": {
|
"@actions/http-client": {
|
||||||
"version": "1.0.11",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
|
||||||
"integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
|
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"tunnel": "0.0.6"
|
"tunnel": "^0.0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
@@ -116,6 +126,11 @@
|
|||||||
"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=="
|
||||||
|
},
|
||||||
|
"uuid": {
|
||||||
|
"version": "8.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
"url": "https://github.com/actions/toolkit/issues"
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.9.1",
|
||||||
"minimatch": "^3.0.4"
|
"minimatch": "^3.0.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/http-client",
|
"name": "@actions/http-client",
|
||||||
"version": "2.0.0",
|
"version": "2.0.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tunnel": "^0.0.6"
|
"tunnel": "^0.0.6"
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/io",
|
"name": "@actions/io",
|
||||||
"version": "1.1.2",
|
"version": "1.1.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/io",
|
"name": "@actions/io",
|
||||||
"version": "1.1.2",
|
"version": "1.1.3",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/io",
|
"name": "@actions/io",
|
||||||
"version": "1.1.2",
|
"version": "1.1.3",
|
||||||
"description": "Actions io lib",
|
"description": "Actions io lib",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"github",
|
"github",
|
||||||
|
|||||||
+12
-3
@@ -4,7 +4,8 @@ import * as path from 'path'
|
|||||||
import {promisify} from 'util'
|
import {promisify} from 'util'
|
||||||
import * as ioUtil from './io-util'
|
import * as ioUtil from './io-util'
|
||||||
|
|
||||||
const exec = promisify(childProcess.exec)
|
// const exec = promisify(childProcess.exec)
|
||||||
|
// const fork = promisify(childProcess.fork)
|
||||||
const execFile = promisify(childProcess.execFile)
|
const execFile = promisify(childProcess.execFile)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -129,12 +130,20 @@ export async function rmRF(inputPath: string): Promise<void> {
|
|||||||
try {
|
try {
|
||||||
const cmdPath = ioUtil.getCmdPath()
|
const cmdPath = ioUtil.getCmdPath()
|
||||||
if (await ioUtil.isDirectory(inputPath, true)) {
|
if (await ioUtil.isDirectory(inputPath, true)) {
|
||||||
await exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, {
|
await execFile(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, {
|
||||||
env: {inputPath}
|
env: {inputPath}
|
||||||
|
}).catch(err => {
|
||||||
|
// if you try to delete a file that doesn't exist, desired result is achieved
|
||||||
|
// other errors are valid
|
||||||
|
if (err.code !== 'ENOENT') throw err
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
await exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, {
|
await execFile(`${cmdPath} /s /c "del /f /a "%inputPath%""`, {
|
||||||
env: {inputPath}
|
env: {inputPath}
|
||||||
|
}).catch(err => {
|
||||||
|
// if you try to delete a file that doesn't exist, desired result is achieved
|
||||||
|
// other errors are valid
|
||||||
|
if (err.code !== 'ENOENT') throw err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Generated
+21
-22
@@ -6,7 +6,7 @@
|
|||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/tool-cache",
|
"name": "@actions/tool-cache",
|
||||||
"version": "2.0.0",
|
"version": "2.0.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.2.6",
|
||||||
@@ -24,19 +24,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
"version": "1.8.0",
|
"version": "1.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
|
||||||
"integrity": "sha512-XirM+Zo/PFlA+1h+i4bkfvagujta+LIM2AOSzPbt8JqXbbuxb1HTB+FqIyaKmue9yiCx/JIJY6pXsOl3+T8JGw==",
|
"integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/http-client": "^1.0.11"
|
"@actions/http-client": "^2.0.1",
|
||||||
|
"uuid": "^8.3.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core/node_modules/@actions/http-client": {
|
"node_modules/@actions/core/node_modules/uuid": {
|
||||||
"version": "1.0.11",
|
"version": "8.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
"integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||||
"dependencies": {
|
"bin": {
|
||||||
"tunnel": "0.0.6"
|
"uuid": "dist/bin/uuid"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/exec": {
|
"node_modules/@actions/exec": {
|
||||||
@@ -291,20 +292,18 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": {
|
"@actions/core": {
|
||||||
"version": "1.8.0",
|
"version": "1.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
|
||||||
"integrity": "sha512-XirM+Zo/PFlA+1h+i4bkfvagujta+LIM2AOSzPbt8JqXbbuxb1HTB+FqIyaKmue9yiCx/JIJY6pXsOl3+T8JGw==",
|
"integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@actions/http-client": "^1.0.11"
|
"@actions/http-client": "^2.0.1",
|
||||||
|
"uuid": "^8.3.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/http-client": {
|
"uuid": {
|
||||||
"version": "1.0.11",
|
"version": "8.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
"integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
|
||||||
"requires": {
|
|
||||||
"tunnel": "0.0.6"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -54,6 +54,16 @@ const AUDIT_ALLOW_LIST = [
|
|||||||
path: "lerna>@lerna/version>@lerna/conventional-commits>conventional-changelog-core>get-pkg-repo>meow>trim-newlines",
|
path: "lerna>@lerna/version>@lerna/conventional-commits>conventional-changelog-core>get-pkg-repo>meow>trim-newlines",
|
||||||
advisoryUrl: "https://www.npmjs.com/advisories/1753",
|
advisoryUrl: "https://www.npmjs.com/advisories/1753",
|
||||||
justification: "dependency of lerna (dev only); low severity"
|
justification: "dependency of lerna (dev only); low severity"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "lerna>@lerna/version>@lerna/github-client>git-url-parse>git-up>parse-url",
|
||||||
|
advisoryUrl: "https://github.com/advisories/GHSA-j9fq-vwqv-2fm2",
|
||||||
|
justification: "dependency of lerna; moderate severity"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "lerna>@lerna/publish>@lerna/version>@lerna/github-client>git-url-parse>git-up>parse-url",
|
||||||
|
advisoryUrl: "https://github.com/advisories/GHSA-j9fq-vwqv-2fm2",
|
||||||
|
justification: "dependency of lerna; moderate severity"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user