mirror of
				https://github.com/actions/setup-go.git
				synced 2025-10-30 23:10:30 +00:00 
			
		
		
		
	Compare commits
	
		
			15 Commits
		
	
	
		
			v5.4.0
			...
			test-macos
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 7a61e9b75a | ||
|   | dd046af70e | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | 8e57b58e57 | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | 7c0b336c9a | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | 6f26dcc668 | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | 8d4083a006 | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | fa96338abe | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | 4de67c04ab | ||
|   | d35c59abb0 | ||
|   | 29694d72cd | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | 78535dd5f2 | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | bb65d8857b | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | 7f17e836c0 | ||
|   | dca8468d37 | ||
|   | 691cc3533f | 
							
								
								
									
										2
									
								
								.github/ISSUE_TEMPLATE/bug_report.md
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/ISSUE_TEMPLATE/bug_report.md
									
									
									
									
										vendored
									
									
								
							| @@ -7,7 +7,7 @@ assignees: '' | |||||||
|  |  | ||||||
| --- | --- | ||||||
|  |  | ||||||
| <!--- Please direct any generic questions related to actions to our support community forum at https://github.community/c/code-to-cloud/github-actions/41 ---> | <!--- Please direct any generic questions related to actions to our support community forum at https://github.com/orgs/community/discussions/categories/actions ---> | ||||||
| <!--- Before opening up a new bug report, please make sure to check for similar existing issues --> | <!--- Before opening up a new bug report, please make sure to check for similar existing issues --> | ||||||
|  |  | ||||||
| **Description:** | **Description:** | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								.github/ISSUE_TEMPLATE/feature_request.md
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/ISSUE_TEMPLATE/feature_request.md
									
									
									
									
										vendored
									
									
								
							| @@ -5,7 +5,7 @@ title: '' | |||||||
| labels: feature request, needs triage | labels: feature request, needs triage | ||||||
| assignees: '' | assignees: '' | ||||||
| --- | --- | ||||||
| <!--- Please direct any generic questions related to actions to our support community forum at https://github.community/c/code-to-cloud/github-actions/41 ---> | <!--- Please direct any generic questions related to actions to our support community forum at https://github.com/orgs/community/discussions/categories/actions ---> | ||||||
| <!--- Before opening up a new feature request, please make sure to check for similar existing issues and pull requests --> | <!--- Before opening up a new feature request, please make sure to check for similar existing issues and pull requests --> | ||||||
|  |  | ||||||
| **Description:** | **Description:** | ||||||
|   | |||||||
							
								
								
									
										90
									
								
								.github/workflows/versions.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										90
									
								
								.github/workflows/versions.yml
									
									
									
									
										vendored
									
									
								
							| @@ -3,7 +3,7 @@ name: Validate 'setup-go' | |||||||
| on: | on: | ||||||
|   push: |   push: | ||||||
|     branches: |     branches: | ||||||
|       - main |       - test-macos-x64-runner | ||||||
|     paths-ignore: |     paths-ignore: | ||||||
|       - '**.md' |       - '**.md' | ||||||
|   pull_request: |   pull_request: | ||||||
| @@ -18,7 +18,7 @@ jobs: | |||||||
|     strategy: |     strategy: | ||||||
|       fail-fast: false |       fail-fast: false | ||||||
|       matrix: |       matrix: | ||||||
|         os: [ubuntu-latest, windows-latest, macos-latest, macos-13] |         os: [macos-14-large] | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v4 |       - uses: actions/checkout@v4 | ||||||
|       - name: Setup Go Stable |       - name: Setup Go Stable | ||||||
| @@ -33,7 +33,7 @@ jobs: | |||||||
|     strategy: |     strategy: | ||||||
|       fail-fast: false |       fail-fast: false | ||||||
|       matrix: |       matrix: | ||||||
|         os: [ubuntu-latest, windows-latest, macos-latest, macos-13] |         os: [macos-14-large] | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v4 |       - uses: actions/checkout@v4 | ||||||
|       - name: Setup Go oldStable |       - name: Setup Go oldStable | ||||||
| @@ -43,28 +43,28 @@ jobs: | |||||||
|       - name: Verify Go |       - name: Verify Go | ||||||
|         run: go version |         run: go version | ||||||
|  |  | ||||||
|   aliases-arch: |   # aliases-arch: | ||||||
|     runs-on: ${{ matrix.os }} |   #   runs-on: ${{ matrix.os }} | ||||||
|     strategy: |   #   strategy: | ||||||
|       fail-fast: false |   #     fail-fast: false | ||||||
|       matrix: |   #     matrix: | ||||||
|         os: [ubuntu-latest, windows-latest, macos-latest, macos-13] |   #       os: [ubuntu-latest, windows-latest, macos-latest, macos-14-large] | ||||||
|         version: [stable, oldstable] |   #       version: [stable, oldstable] | ||||||
|         architecture: [x64, x32] |   #       architecture: [x64, x32] | ||||||
|         exclude: |   #       exclude: | ||||||
|           - os: macos-latest |   #         - os: macos-latest | ||||||
|             architecture: x32 |   #           architecture: x32 | ||||||
|           - os: macos-13 |   #         - os: macos-14-large | ||||||
|             architecture: x32 |   #           architecture: x32 | ||||||
|     steps: |   #   steps: | ||||||
|       - uses: actions/checkout@v4 |   #     - uses: actions/checkout@v4 | ||||||
|       - name: Setup Go ${{ matrix.version }} ${{ matrix.architecture }} |   #     - name: Setup Go ${{ matrix.version }} ${{ matrix.architecture }} | ||||||
|         uses: ./ |   #       uses: ./ | ||||||
|         with: |   #       with: | ||||||
|           go-version: ${{ matrix.version }} |   #         go-version: ${{ matrix.version }} | ||||||
|           architecture: ${{ matrix.architecture }} |   #         architecture: ${{ matrix.architecture }} | ||||||
|       - name: Verify Go |   #     - name: Verify Go | ||||||
|         run: go version |   #       run: go version | ||||||
|  |  | ||||||
|   local-cache: |   local-cache: | ||||||
|     name: Setup local-cache version |     name: Setup local-cache version | ||||||
| @@ -72,14 +72,14 @@ jobs: | |||||||
|     strategy: |     strategy: | ||||||
|       fail-fast: false |       fail-fast: false | ||||||
|       matrix: |       matrix: | ||||||
|         os: [macos-latest, windows-latest, ubuntu-latest, macos-13] |         os: [macos-14-large] | ||||||
|         go: [1.21.13, 1.22.8, 1.23.2] |         go: [1.21.13, 1.22.8, 1.23.2] | ||||||
|         include: |         # include: | ||||||
|           - os: windows-latest |         #   - os: windows-latest | ||||||
|             go: 1.20.14 |         #     go: 1.20.14 | ||||||
|         exclude: |         # exclude: | ||||||
|           - os: windows-latest |         #   - os: windows-latest | ||||||
|             go: 1.23.2 |         #     go: 1.23.2 | ||||||
|     steps: |     steps: | ||||||
|       - name: Checkout |       - name: Checkout | ||||||
|         uses: actions/checkout@v4 |         uses: actions/checkout@v4 | ||||||
| @@ -98,7 +98,7 @@ jobs: | |||||||
|     strategy: |     strategy: | ||||||
|       fail-fast: false |       fail-fast: false | ||||||
|       matrix: |       matrix: | ||||||
|         os: [ubuntu-latest, windows-latest, macos-latest, macos-13] |         os: [macos-14-large] | ||||||
|         go-version: ['1.20', '1.21', '1.22', '1.23'] |         go-version: ['1.20', '1.21', '1.22', '1.23'] | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v4 |       - uses: actions/checkout@v4 | ||||||
| @@ -115,7 +115,7 @@ jobs: | |||||||
|     strategy: |     strategy: | ||||||
|       fail-fast: false |       fail-fast: false | ||||||
|       matrix: |       matrix: | ||||||
|         os: [ubuntu-latest, windows-latest, macos-latest, macos-13] |         os: [macos-14-large] | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v4 |       - uses: actions/checkout@v4 | ||||||
|       - name: Setup Go and check latest |       - name: Setup Go and check latest | ||||||
| @@ -131,7 +131,7 @@ jobs: | |||||||
|     strategy: |     strategy: | ||||||
|       fail-fast: false |       fail-fast: false | ||||||
|       matrix: |       matrix: | ||||||
|         os: [ubuntu-latest, windows-latest, macos-latest, macos-13] |         os: [macos-14-large] | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v4 |       - uses: actions/checkout@v4 | ||||||
|       - name: Setup Go and check latest |       - name: Setup Go and check latest | ||||||
| @@ -147,7 +147,7 @@ jobs: | |||||||
|     strategy: |     strategy: | ||||||
|       fail-fast: false |       fail-fast: false | ||||||
|       matrix: |       matrix: | ||||||
|         os: [macos-latest, windows-latest, ubuntu-latest, macos-13] |         os: [macos-14-large] | ||||||
|         go: [1.20.14, 1.21.10, 1.22.8, 1.23.2] |         go: [1.20.14, 1.21.10, 1.22.8, 1.23.2] | ||||||
|     steps: |     steps: | ||||||
|       - name: Checkout |       - name: Checkout | ||||||
| @@ -167,7 +167,7 @@ jobs: | |||||||
|     strategy: |     strategy: | ||||||
|       fail-fast: false |       fail-fast: false | ||||||
|       matrix: |       matrix: | ||||||
|         os: [windows-latest, ubuntu-latest, macos-13] |         os: [macos-14-large] | ||||||
|         go: [1.11.12] |         go: [1.11.12] | ||||||
|     steps: |     steps: | ||||||
|       - name: Checkout |       - name: Checkout | ||||||
| @@ -187,16 +187,16 @@ jobs: | |||||||
|     strategy: |     strategy: | ||||||
|       fail-fast: false |       fail-fast: false | ||||||
|       matrix: |       matrix: | ||||||
|         os: [ubuntu-latest, windows-latest, macos-latest, macos-13] |         os: [macos-14-large] | ||||||
|         go-version: [1.20.14, 1.21, 1.22, 1.23] |         go-version: [1.20.14, 1.21, 1.22, 1.23] | ||||||
|         include: |         include: | ||||||
|           - os: macos-latest |           # - os: macos-latest | ||||||
|             architecture: arm64 |           #   architecture: arm64 | ||||||
|           - os: ubuntu-latest |           # - os: ubuntu-latest | ||||||
|             architecture: x64 |           #   architecture: x64 | ||||||
|           - os: windows-latest |           # - os: windows-latest | ||||||
|             architecture: x64 |           #   architecture: x64 | ||||||
|           - os: macos-13 |           - os: macos-14-large | ||||||
|             architecture: x64 |             architecture: x64 | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v4 |       - uses: actions/checkout@v4 | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							| @@ -1,6 +1,6 @@ | |||||||
| --- | --- | ||||||
| name: "@actions/cache" | name: "@actions/cache" | ||||||
| version: 4.0.2 | version: 4.0.3 | ||||||
| type: npm | type: npm | ||||||
| summary: Actions cache lib | summary: Actions cache lib | ||||||
| homepage: https://github.com/actions/toolkit/tree/main/packages/cache | homepage: https://github.com/actions/toolkit/tree/main/packages/cache | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- | --- | ||||||
| name: "@actions/glob" | name: "@actions/glob" | ||||||
| version: 0.4.0 | version: 0.5.0 | ||||||
| type: npm | type: npm | ||||||
| summary: Actions glob lib | summary: Actions glob lib | ||||||
| homepage: https://github.com/actions/toolkit/tree/main/packages/glob | homepage: https://github.com/actions/toolkit/tree/main/packages/glob | ||||||
							
								
								
									
										2
									
								
								.licenses/npm/@actions/tool-cache.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@actions/tool-cache.dep.yml
									
									
									
										generated
									
									
									
								
							| @@ -1,6 +1,6 @@ | |||||||
| --- | --- | ||||||
| name: "@actions/tool-cache" | name: "@actions/tool-cache" | ||||||
| version: 2.0.1 | version: 2.0.2 | ||||||
| type: npm | type: npm | ||||||
| summary: Actions tool-cache lib | summary: Actions tool-cache lib | ||||||
| homepage: https://github.com/actions/toolkit/tree/main/packages/tool-cache | homepage: https://github.com/actions/toolkit/tree/main/packages/tool-cache | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								.licenses/npm/brace-expansion.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/brace-expansion.dep.yml
									
									
									
										generated
									
									
									
								
							| @@ -1,6 +1,6 @@ | |||||||
| --- | --- | ||||||
| name: brace-expansion | name: brace-expansion | ||||||
| version: 1.1.11 | version: 1.1.12 | ||||||
| type: npm | type: npm | ||||||
| summary: Brace expansion as known from sh/bash | summary: Brace expansion as known from sh/bash | ||||||
| homepage: https://github.com/juliangruber/brace-expansion | homepage: https://github.com/juliangruber/brace-expansion | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- | --- | ||||||
| name: semver | name: semver | ||||||
| version: 7.6.3 | version: 7.7.1 | ||||||
| type: npm | type: npm | ||||||
| summary: The semantic version parser used by npm. | summary: The semantic version parser used by npm. | ||||||
| homepage: | homepage: | ||||||
							
								
								
									
										2
									
								
								.licenses/npm/undici.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/undici.dep.yml
									
									
									
										generated
									
									
									
								
							| @@ -1,6 +1,6 @@ | |||||||
| --- | --- | ||||||
| name: undici | name: undici | ||||||
| version: 5.28.5 | version: 5.29.0 | ||||||
| type: npm | type: npm | ||||||
| summary: An HTTP/1.1 client, written from scratch for Node.js | summary: An HTTP/1.1 client, written from scratch for Node.js | ||||||
| homepage: https://undici.nodejs.org | homepage: https://undici.nodejs.org | ||||||
|   | |||||||
							
								
								
									
										39
									
								
								.licenses/npm/uuid-3.4.0.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										39
									
								
								.licenses/npm/uuid-3.4.0.dep.yml
									
									
									
										generated
									
									
									
								
							| @@ -1,39 +0,0 @@ | |||||||
| --- |  | ||||||
| name: uuid |  | ||||||
| version: 3.4.0 |  | ||||||
| type: npm |  | ||||||
| summary: RFC4122 (v1, v4, and v5) UUIDs |  | ||||||
| homepage: https://github.com/uuidjs/uuid#readme |  | ||||||
| license: mit |  | ||||||
| licenses: |  | ||||||
| - sources: LICENSE.md |  | ||||||
|   text: | |  | ||||||
|     The MIT License (MIT) |  | ||||||
| 
 |  | ||||||
|     Copyright (c) 2010-2016 Robert Kieffer and other contributors |  | ||||||
| 
 |  | ||||||
|     Permission is hereby granted, free of charge, to any person obtaining a copy |  | ||||||
|     of this software and associated documentation files (the "Software"), to deal |  | ||||||
|     in the Software without restriction, including without limitation the rights |  | ||||||
|     to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |  | ||||||
|     copies of the Software, and to permit persons to whom the Software is |  | ||||||
|     furnished to do so, subject to the following conditions: |  | ||||||
| 
 |  | ||||||
|     The above copyright notice and this permission notice shall be included in all |  | ||||||
|     copies or substantial portions of the Software. |  | ||||||
| 
 |  | ||||||
|     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |  | ||||||
|     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |  | ||||||
|     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |  | ||||||
|     AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |  | ||||||
|     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |  | ||||||
|     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |  | ||||||
|     SOFTWARE. |  | ||||||
| notices: |  | ||||||
| - sources: AUTHORS |  | ||||||
|   text: |- |  | ||||||
|     Robert Kieffer <robert@broofa.com> |  | ||||||
|     Christoph Tavan <dev@tavan.de> |  | ||||||
|     AJ ONeal <coolaj86@gmail.com> |  | ||||||
|     Vincent Voyer <vincent@zeroload.net> |  | ||||||
|     Roman Shtylman <shtylman@gmail.com> |  | ||||||
| @@ -3,7 +3,7 @@ name: uuid | |||||||
| version: 8.3.2 | version: 8.3.2 | ||||||
| type: npm | type: npm | ||||||
| summary: RFC4122 (v1, v4, and v5) UUIDs | summary: RFC4122 (v1, v4, and v5) UUIDs | ||||||
| homepage: https://github.com/uuidjs/uuid#readme | homepage: | ||||||
| license: mit | license: mit | ||||||
| licenses: | licenses: | ||||||
| - sources: LICENSE.md | - sources: LICENSE.md | ||||||
							
								
								
									
										52
									
								
								__tests__/utils.test.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								__tests__/utils.test.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,52 @@ | |||||||
|  | import {isSelfHosted} from '../src/utils'; | ||||||
|  |  | ||||||
|  | describe('utils', () => { | ||||||
|  |   describe('isSelfHosted', () => { | ||||||
|  |     let AGENT_ISSELFHOSTED: string | undefined; | ||||||
|  |     let RUNNER_ENVIRONMENT: string | undefined; | ||||||
|  |  | ||||||
|  |     beforeEach(() => { | ||||||
|  |       AGENT_ISSELFHOSTED = process.env['AGENT_ISSELFHOSTED']; | ||||||
|  |       delete process.env['AGENT_ISSELFHOSTED']; | ||||||
|  |       RUNNER_ENVIRONMENT = process.env['RUNNER_ENVIRONMENT']; | ||||||
|  |       delete process.env['RUNNER_ENVIRONMENT']; | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |     afterEach(() => { | ||||||
|  |       if (AGENT_ISSELFHOSTED === undefined) { | ||||||
|  |         delete process.env['AGENT_ISSELFHOSTED']; | ||||||
|  |       } else { | ||||||
|  |         process.env['AGENT_ISSELFHOSTED'] = AGENT_ISSELFHOSTED; | ||||||
|  |       } | ||||||
|  |       if (RUNNER_ENVIRONMENT === undefined) { | ||||||
|  |         delete process.env['RUNNER_ENVIRONMENT']; | ||||||
|  |       } else { | ||||||
|  |         process.env['RUNNER_ENVIRONMENT'] = RUNNER_ENVIRONMENT; | ||||||
|  |       } | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |     it('isSelfHosted should be true if no environment variables set', () => { | ||||||
|  |       expect(isSelfHosted()).toBeTruthy(); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |     it('isSelfHosted should be true if environment variable is not set to denote GitHub hosted', () => { | ||||||
|  |       process.env['RUNNER_ENVIRONMENT'] = 'some'; | ||||||
|  |       expect(isSelfHosted()).toBeTruthy(); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |     it('isSelfHosted should be true if environment variable set to denote Azure Pipelines self hosted', () => { | ||||||
|  |       process.env['AGENT_ISSELFHOSTED'] = '1'; | ||||||
|  |       expect(isSelfHosted()).toBeTruthy(); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |     it('isSelfHosted should be false if environment variable set to denote GitHub hosted', () => { | ||||||
|  |       process.env['RUNNER_ENVIRONMENT'] = 'github-hosted'; | ||||||
|  |       expect(isSelfHosted()).toBeFalsy(); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |     it('isSelfHosted should be false if environment variable is not set to denote Azure Pipelines self hosted', () => { | ||||||
|  |       process.env['AGENT_ISSELFHOSTED'] = 'some'; | ||||||
|  |       expect(isSelfHosted()).toBeFalsy(); | ||||||
|  |     }); | ||||||
|  |   }); | ||||||
|  | }); | ||||||
							
								
								
									
										188
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										188
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							| @@ -220,7 +220,7 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr | |||||||
|             }; |             }; | ||||||
|             const response = yield twirpClient.GetCacheEntryDownloadURL(request); |             const response = yield twirpClient.GetCacheEntryDownloadURL(request); | ||||||
|             if (!response.ok) { |             if (!response.ok) { | ||||||
|                 core.debug(`Cache not found for keys: ${keys.join(', ')}`); |                 core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`); | ||||||
|                 return undefined; |                 return undefined; | ||||||
|             } |             } | ||||||
|             core.info(`Cache hit for: ${request.key}`); |             core.info(`Cache hit for: ${request.key}`); | ||||||
| @@ -2204,6 +2204,7 @@ const cacheUtils_1 = __nccwpck_require__(1518); | |||||||
| const auth_1 = __nccwpck_require__(5526); | const auth_1 = __nccwpck_require__(5526); | ||||||
| const http_client_1 = __nccwpck_require__(6255); | const http_client_1 = __nccwpck_require__(6255); | ||||||
| const cache_twirp_client_1 = __nccwpck_require__(2655); | const cache_twirp_client_1 = __nccwpck_require__(2655); | ||||||
|  | const util_1 = __nccwpck_require__(1953); | ||||||
| /** | /** | ||||||
|  * This class is a wrapper around the CacheServiceClientJSON class generated by Twirp. |  * This class is a wrapper around the CacheServiceClientJSON class generated by Twirp. | ||||||
|  * |  * | ||||||
| @@ -2263,6 +2264,7 @@ class CacheServiceClient { | |||||||
|                     (0, core_1.debug)(`[Response] - ${response.message.statusCode}`); |                     (0, core_1.debug)(`[Response] - ${response.message.statusCode}`); | ||||||
|                     (0, core_1.debug)(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`); |                     (0, core_1.debug)(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`); | ||||||
|                     const body = JSON.parse(rawBody); |                     const body = JSON.parse(rawBody); | ||||||
|  |                     (0, util_1.maskSecretUrls)(body); | ||||||
|                     (0, core_1.debug)(`Body: ${JSON.stringify(body, null, 2)}`); |                     (0, core_1.debug)(`Body: ${JSON.stringify(body, null, 2)}`); | ||||||
|                     if (this.isSuccessStatusCode(statusCode)) { |                     if (this.isSuccessStatusCode(statusCode)) { | ||||||
|                         return { response, body }; |                         return { response, body }; | ||||||
| @@ -2444,6 +2446,87 @@ exports.getUserAgentString = getUserAgentString; | |||||||
| 
 | 
 | ||||||
| /***/ }), | /***/ }), | ||||||
| 
 | 
 | ||||||
|  | /***/ 1953: | ||||||
|  | /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { | ||||||
|  | 
 | ||||||
|  | "use strict"; | ||||||
|  | 
 | ||||||
|  | Object.defineProperty(exports, "__esModule", ({ value: true })); | ||||||
|  | exports.maskSecretUrls = exports.maskSigUrl = void 0; | ||||||
|  | const core_1 = __nccwpck_require__(2186); | ||||||
|  | /** | ||||||
|  |  * Masks the `sig` parameter in a URL and sets it as a secret. | ||||||
|  |  * | ||||||
|  |  * @param url - The URL containing the signature parameter to mask | ||||||
|  |  * @remarks | ||||||
|  |  * This function attempts to parse the provided URL and identify the 'sig' query parameter. | ||||||
|  |  * If found, it registers both the raw and URL-encoded signature values as secrets using | ||||||
|  |  * the Actions `setSecret` API, which prevents them from being displayed in logs. | ||||||
|  |  * | ||||||
|  |  * The function handles errors gracefully if URL parsing fails, logging them as debug messages. | ||||||
|  |  * | ||||||
|  |  * @example | ||||||
|  |  * ```typescript
 | ||||||
|  |  * // Mask a signature in an Azure SAS token URL
 | ||||||
|  |  * maskSigUrl('https://example.blob.core.windows.net/container/file.txt?sig=abc123&se=2023-01-01'); | ||||||
|  |  * ``` | ||||||
|  |  */ | ||||||
|  | function maskSigUrl(url) { | ||||||
|  |     if (!url) | ||||||
|  |         return; | ||||||
|  |     try { | ||||||
|  |         const parsedUrl = new URL(url); | ||||||
|  |         const signature = parsedUrl.searchParams.get('sig'); | ||||||
|  |         if (signature) { | ||||||
|  |             (0, core_1.setSecret)(signature); | ||||||
|  |             (0, core_1.setSecret)(encodeURIComponent(signature)); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |     catch (error) { | ||||||
|  |         (0, core_1.debug)(`Failed to parse URL: ${url} ${error instanceof Error ? error.message : String(error)}`); | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | exports.maskSigUrl = maskSigUrl; | ||||||
|  | /** | ||||||
|  |  * Masks sensitive information in URLs containing signature parameters. | ||||||
|  |  * Currently supports masking 'sig' parameters in the 'signed_upload_url' | ||||||
|  |  * and 'signed_download_url' properties of the provided object. | ||||||
|  |  * | ||||||
|  |  * @param body - The object should contain a signature | ||||||
|  |  * @remarks | ||||||
|  |  * This function extracts URLs from the object properties and calls maskSigUrl | ||||||
|  |  * on each one to redact sensitive signature information. The function doesn't | ||||||
|  |  * modify the original object; it only marks the signatures as secrets for | ||||||
|  |  * logging purposes. | ||||||
|  |  * | ||||||
|  |  * @example | ||||||
|  |  * ```typescript
 | ||||||
|  |  * const responseBody = { | ||||||
|  |  *   signed_upload_url: 'https://blob.core.windows.net/?sig=abc123', | ||||||
|  |  *   signed_download_url: 'https://blob.core/windows.net/?sig=def456' | ||||||
|  |  * }; | ||||||
|  |  * maskSecretUrls(responseBody); | ||||||
|  |  * ``` | ||||||
|  |  */ | ||||||
|  | function maskSecretUrls(body) { | ||||||
|  |     if (typeof body !== 'object' || body === null) { | ||||||
|  |         (0, core_1.debug)('body is not an object or is null'); | ||||||
|  |         return; | ||||||
|  |     } | ||||||
|  |     if ('signed_upload_url' in body && | ||||||
|  |         typeof body.signed_upload_url === 'string') { | ||||||
|  |         maskSigUrl(body.signed_upload_url); | ||||||
|  |     } | ||||||
|  |     if ('signed_download_url' in body && | ||||||
|  |         typeof body.signed_download_url === 'string') { | ||||||
|  |         maskSigUrl(body.signed_download_url); | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | exports.maskSecretUrls = maskSecretUrls; | ||||||
|  | //# sourceMappingURL=util.js.map
 | ||||||
|  | 
 | ||||||
|  | /***/ }), | ||||||
|  | 
 | ||||||
| /***/ 6490: | /***/ 6490: | ||||||
| /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { | /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { | ||||||
| 
 | 
 | ||||||
| @@ -51494,7 +51577,7 @@ function expand(str, isTop) { | |||||||
|   var isOptions = m.body.indexOf(',') >= 0; |   var isOptions = m.body.indexOf(',') >= 0; | ||||||
|   if (!isSequence && !isOptions) { |   if (!isSequence && !isOptions) { | ||||||
|     // {a},b}
 |     // {a},b}
 | ||||||
|     if (m.post.match(/,.*\}/)) { |     if (m.post.match(/,(?!,).*\}/)) { | ||||||
|       str = m.pre + '{' + m.body + escClose + m.post; |       str = m.pre + '{' + m.body + escClose + m.post; | ||||||
|       return expand(str); |       return expand(str); | ||||||
|     } |     } | ||||||
| @@ -62719,7 +62802,7 @@ module.exports = { | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| const { parseSetCookie } = __nccwpck_require__(4408) | const { parseSetCookie } = __nccwpck_require__(4408) | ||||||
| const { stringify, getHeadersList } = __nccwpck_require__(3121) | const { stringify } = __nccwpck_require__(3121) | ||||||
| const { webidl } = __nccwpck_require__(1744) | const { webidl } = __nccwpck_require__(1744) | ||||||
| const { Headers } = __nccwpck_require__(554) | const { Headers } = __nccwpck_require__(554) | ||||||
| 
 | 
 | ||||||
| @@ -62795,14 +62878,13 @@ function getSetCookies (headers) { | |||||||
| 
 | 
 | ||||||
|   webidl.brandCheck(headers, Headers, { strict: false }) |   webidl.brandCheck(headers, Headers, { strict: false }) | ||||||
| 
 | 
 | ||||||
|   const cookies = getHeadersList(headers).cookies |   const cookies = headers.getSetCookie() | ||||||
| 
 | 
 | ||||||
|   if (!cookies) { |   if (!cookies) { | ||||||
|     return [] |     return [] | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   // In older versions of undici, cookies is a list of name:value.
 |   return cookies.map((pair) => parseSetCookie(pair)) | ||||||
|   return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair)) |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
| @@ -63230,14 +63312,15 @@ module.exports = { | |||||||
| /***/ }), | /***/ }), | ||||||
| 
 | 
 | ||||||
| /***/ 3121: | /***/ 3121: | ||||||
| /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | /***/ ((module) => { | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| const assert = __nccwpck_require__(9491) | /** | ||||||
| const { kHeadersList } = __nccwpck_require__(2785) |  * @param {string} value | ||||||
| 
 |  * @returns {boolean} | ||||||
|  |  */ | ||||||
| function isCTLExcludingHtab (value) { | function isCTLExcludingHtab (value) { | ||||||
|   if (value.length === 0) { |   if (value.length === 0) { | ||||||
|     return false |     return false | ||||||
| @@ -63498,31 +63581,13 @@ function stringify (cookie) { | |||||||
|   return out.join('; ') |   return out.join('; ') | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| let kHeadersListNode |  | ||||||
| 
 |  | ||||||
| function getHeadersList (headers) { |  | ||||||
|   if (headers[kHeadersList]) { |  | ||||||
|     return headers[kHeadersList] |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   if (!kHeadersListNode) { |  | ||||||
|     kHeadersListNode = Object.getOwnPropertySymbols(headers).find( |  | ||||||
|       (symbol) => symbol.description === 'headers list' |  | ||||||
|     ) |  | ||||||
| 
 |  | ||||||
|     assert(kHeadersListNode, 'Headers cannot be parsed') |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   const headersList = headers[kHeadersListNode] |  | ||||||
|   assert(headersList) |  | ||||||
| 
 |  | ||||||
|   return headersList |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| module.exports = { | module.exports = { | ||||||
|   isCTLExcludingHtab, |   isCTLExcludingHtab, | ||||||
|   stringify, |   validateCookieName, | ||||||
|   getHeadersList |   validateCookiePath, | ||||||
|  |   validateCookieValue, | ||||||
|  |   toIMFDate, | ||||||
|  |   stringify | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @@ -67526,6 +67591,7 @@ const { | |||||||
|   isValidHeaderName, |   isValidHeaderName, | ||||||
|   isValidHeaderValue |   isValidHeaderValue | ||||||
| } = __nccwpck_require__(2538) | } = __nccwpck_require__(2538) | ||||||
|  | const util = __nccwpck_require__(3837) | ||||||
| const { webidl } = __nccwpck_require__(1744) | const { webidl } = __nccwpck_require__(1744) | ||||||
| const assert = __nccwpck_require__(9491) | const assert = __nccwpck_require__(9491) | ||||||
| 
 | 
 | ||||||
| @@ -68079,6 +68145,9 @@ Object.defineProperties(Headers.prototype, { | |||||||
|   [Symbol.toStringTag]: { |   [Symbol.toStringTag]: { | ||||||
|     value: 'Headers', |     value: 'Headers', | ||||||
|     configurable: true |     configurable: true | ||||||
|  |   }, | ||||||
|  |   [util.inspect.custom]: { | ||||||
|  |     enumerable: false | ||||||
|   } |   } | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
| @@ -77255,6 +77324,20 @@ class Pool extends PoolBase { | |||||||
|       ? { ...options.interceptors } |       ? { ...options.interceptors } | ||||||
|       : undefined |       : undefined | ||||||
|     this[kFactory] = factory |     this[kFactory] = factory | ||||||
|  | 
 | ||||||
|  |     this.on('connectionError', (origin, targets, error) => { | ||||||
|  |       // If a connection error occurs, we remove the client from the pool,
 | ||||||
|  |       // and emit a connectionError event. They will not be re-used.
 | ||||||
|  |       // Fixes https://github.com/nodejs/undici/issues/3895
 | ||||||
|  |       for (const target of targets) { | ||||||
|  |         // Do not use kRemoveClient here, as it will close the client,
 | ||||||
|  |         // but the client cannot be closed in this state.
 | ||||||
|  |         const idx = this[kClients].indexOf(target) | ||||||
|  |         if (idx !== -1) { | ||||||
|  |           this[kClients].splice(idx, 1) | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     }) | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   [kGetDispatcher] () { |   [kGetDispatcher] () { | ||||||
| @@ -86548,13 +86631,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( | |||||||
| }) : function(o, v) { | }) : function(o, v) { | ||||||
|     o["default"] = v; |     o["default"] = v; | ||||||
| }); | }); | ||||||
| var __importStar = (this && this.__importStar) || function (mod) { | var __importStar = (this && this.__importStar) || (function () { | ||||||
|  |     var ownKeys = function(o) { | ||||||
|  |         ownKeys = Object.getOwnPropertyNames || function (o) { | ||||||
|  |             var ar = []; | ||||||
|  |             for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; | ||||||
|  |             return ar; | ||||||
|  |         }; | ||||||
|  |         return ownKeys(o); | ||||||
|  |     }; | ||||||
|  |     return function (mod) { | ||||||
|         if (mod && mod.__esModule) return mod; |         if (mod && mod.__esModule) return mod; | ||||||
|         var result = {}; |         var result = {}; | ||||||
|     if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); |         if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); | ||||||
|         __setModuleDefault(result, mod); |         __setModuleDefault(result, mod); | ||||||
|         return result; |         return result; | ||||||
|     }; |     }; | ||||||
|  | })(); | ||||||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||||||
|     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } |     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||||||
|     return new (P || (P = Promise))(function (resolve, reject) { |     return new (P || (P = Promise))(function (resolve, reject) { | ||||||
| @@ -86568,7 +86661,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { | |||||||
|     return (mod && mod.__esModule) ? mod : { "default": mod }; |     return (mod && mod.__esModule) ? mod : { "default": mod }; | ||||||
| }; | }; | ||||||
| Object.defineProperty(exports, "__esModule", ({ value: true })); | Object.defineProperty(exports, "__esModule", ({ value: true })); | ||||||
| exports.run = void 0; | exports.run = run; | ||||||
| const core = __importStar(__nccwpck_require__(2186)); | const core = __importStar(__nccwpck_require__(2186)); | ||||||
| const cache = __importStar(__nccwpck_require__(7799)); | const cache = __importStar(__nccwpck_require__(7799)); | ||||||
| const fs_1 = __importDefault(__nccwpck_require__(7147)); | const fs_1 = __importDefault(__nccwpck_require__(7147)); | ||||||
| @@ -86607,7 +86700,6 @@ function run(earlyExit) { | |||||||
|         } |         } | ||||||
|     }); |     }); | ||||||
| } | } | ||||||
| exports.run = run; |  | ||||||
| const cachePackages = () => __awaiter(void 0, void 0, void 0, function* () { | const cachePackages = () => __awaiter(void 0, void 0, void 0, function* () { | ||||||
|     const packageManager = 'default'; |     const packageManager = 'default'; | ||||||
|     const state = core.getState(constants_1.State.CacheMatchedKey); |     const state = core.getState(constants_1.State.CacheMatchedKey); | ||||||
| @@ -86666,13 +86758,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( | |||||||
| }) : function(o, v) { | }) : function(o, v) { | ||||||
|     o["default"] = v; |     o["default"] = v; | ||||||
| }); | }); | ||||||
| var __importStar = (this && this.__importStar) || function (mod) { | var __importStar = (this && this.__importStar) || (function () { | ||||||
|  |     var ownKeys = function(o) { | ||||||
|  |         ownKeys = Object.getOwnPropertyNames || function (o) { | ||||||
|  |             var ar = []; | ||||||
|  |             for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; | ||||||
|  |             return ar; | ||||||
|  |         }; | ||||||
|  |         return ownKeys(o); | ||||||
|  |     }; | ||||||
|  |     return function (mod) { | ||||||
|         if (mod && mod.__esModule) return mod; |         if (mod && mod.__esModule) return mod; | ||||||
|         var result = {}; |         var result = {}; | ||||||
|     if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); |         if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); | ||||||
|         __setModuleDefault(result, mod); |         __setModuleDefault(result, mod); | ||||||
|         return result; |         return result; | ||||||
|     }; |     }; | ||||||
|  | })(); | ||||||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||||||
|     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } |     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||||||
|     return new (P || (P = Promise))(function (resolve, reject) { |     return new (P || (P = Promise))(function (resolve, reject) { | ||||||
| @@ -86683,7 +86785,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge | |||||||
|     }); |     }); | ||||||
| }; | }; | ||||||
| Object.defineProperty(exports, "__esModule", ({ value: true })); | Object.defineProperty(exports, "__esModule", ({ value: true })); | ||||||
| exports.isCacheFeatureAvailable = exports.isGhes = exports.getCacheDirectoryPath = exports.getPackageManagerInfo = exports.getCommandOutput = void 0; | exports.getCacheDirectoryPath = exports.getPackageManagerInfo = exports.getCommandOutput = void 0; | ||||||
|  | exports.isGhes = isGhes; | ||||||
|  | exports.isCacheFeatureAvailable = isCacheFeatureAvailable; | ||||||
| const cache = __importStar(__nccwpck_require__(7799)); | const cache = __importStar(__nccwpck_require__(7799)); | ||||||
| const core = __importStar(__nccwpck_require__(2186)); | const core = __importStar(__nccwpck_require__(2186)); | ||||||
| const exec = __importStar(__nccwpck_require__(1514)); | const exec = __importStar(__nccwpck_require__(1514)); | ||||||
| @@ -86733,7 +86837,6 @@ function isGhes() { | |||||||
|     const isLocalHost = hostname.endsWith('.LOCALHOST'); |     const isLocalHost = hostname.endsWith('.LOCALHOST'); | ||||||
|     return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost; |     return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost; | ||||||
| } | } | ||||||
| exports.isGhes = isGhes; |  | ||||||
| function isCacheFeatureAvailable() { | function isCacheFeatureAvailable() { | ||||||
|     if (cache.isFeatureAvailable()) { |     if (cache.isFeatureAvailable()) { | ||||||
|         return true; |         return true; | ||||||
| @@ -86745,7 +86848,6 @@ function isCacheFeatureAvailable() { | |||||||
|     core.warning('The runner was not able to contact the cache service. Caching will be skipped'); |     core.warning('The runner was not able to contact the cache service. Caching will be skipped'); | ||||||
|     return false; |     return false; | ||||||
| } | } | ||||||
| exports.isCacheFeatureAvailable = isCacheFeatureAvailable; |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| /***/ }), | /***/ }), | ||||||
| @@ -88674,7 +88776,7 @@ module.exports = parseParams | |||||||
| /***/ ((module) => { | /***/ ((module) => { | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
| module.exports = JSON.parse('{"name":"@actions/cache","version":"4.0.2","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/semver":"^6.0.0","typescript":"^5.2.2"}}'); | module.exports = JSON.parse('{"name":"@actions/cache","version":"4.0.3","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/node":"^22.13.9","@types/semver":"^6.0.0","typescript":"^5.2.2"}}'); | ||||||
| 
 | 
 | ||||||
| /***/ }), | /***/ }), | ||||||
| 
 | 
 | ||||||
|   | |||||||
							
								
								
									
										617
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										617
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										991
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										991
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										18
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								package.json
									
									
									
									
									
								
							| @@ -25,31 +25,31 @@ | |||||||
|   "author": "GitHub", |   "author": "GitHub", | ||||||
|   "license": "MIT", |   "license": "MIT", | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "@actions/cache": "^4.0.2", |     "@actions/cache": "^4.0.3", | ||||||
|     "@actions/core": "^1.11.1", |     "@actions/core": "^1.11.1", | ||||||
|     "@actions/exec": "^1.1.1", |     "@actions/exec": "^1.1.1", | ||||||
|     "@actions/glob": "^0.4.0", |     "@actions/glob": "^0.5.0", | ||||||
|     "@actions/http-client": "^2.2.1", |     "@actions/http-client": "^2.2.1", | ||||||
|     "@actions/io": "^1.0.2", |     "@actions/io": "^1.0.2", | ||||||
|     "@actions/tool-cache": "^2.0.1", |     "@actions/tool-cache": "^2.0.2", | ||||||
|     "semver": "^7.6.3" |     "semver": "^7.6.3" | ||||||
|   }, |   }, | ||||||
|   "devDependencies": { |   "devDependencies": { | ||||||
|     "@types/jest": "^29.5.12", |     "@types/jest": "^29.5.14", | ||||||
|     "@types/node": "^20.11.28", |     "@types/node": "^20.11.28", | ||||||
|     "@types/semver": "^7.5.8", |     "@types/semver": "^7.5.8", | ||||||
|     "@typescript-eslint/eslint-plugin": "^5.54.0", |     "@typescript-eslint/eslint-plugin": "^8.31.1", | ||||||
|     "@typescript-eslint/parser": "^5.54.0", |     "@typescript-eslint/parser": "^8.35.1", | ||||||
|     "@vercel/ncc": "^0.38.1", |     "@vercel/ncc": "^0.38.1", | ||||||
|     "eslint": "^8.57.0", |     "eslint": "^8.57.0", | ||||||
|     "eslint-config-prettier": "^10.0.1", |     "eslint-config-prettier": "^10.0.1", | ||||||
|     "eslint-plugin-jest": "^27.9.0", |     "eslint-plugin-jest": "^29.0.1", | ||||||
|     "eslint-plugin-node": "^11.1.0", |     "eslint-plugin-node": "^11.1.0", | ||||||
|     "jest": "^29.7.0", |     "jest": "^29.7.0", | ||||||
|     "jest-circus": "^29.7.0", |     "jest-circus": "^29.7.0", | ||||||
|     "nock": "^10.0.6", |     "nock": "^10.0.6", | ||||||
|     "prettier": "^2.8.4", |     "prettier": "^2.8.4", | ||||||
|     "ts-jest": "^29.1.2", |     "ts-jest": "^29.3.2", | ||||||
|     "typescript": "^5.4.2" |     "typescript": "^5.8.3" | ||||||
|   } |   } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ import * as httpm from '@actions/http-client'; | |||||||
| import * as sys from './system'; | import * as sys from './system'; | ||||||
| import fs from 'fs'; | import fs from 'fs'; | ||||||
| import os from 'os'; | import os from 'os'; | ||||||
| import {StableReleaseAlias} from './utils'; | import {StableReleaseAlias, isSelfHosted} from './utils'; | ||||||
|  |  | ||||||
| const MANIFEST_REPO_OWNER = 'actions'; | const MANIFEST_REPO_OWNER = 'actions'; | ||||||
| const MANIFEST_REPO_NAME = 'go-versions'; | const MANIFEST_REPO_NAME = 'go-versions'; | ||||||
| @@ -180,11 +180,7 @@ async function cacheWindowsDir( | |||||||
|   if (os.platform() !== 'win32') return false; |   if (os.platform() !== 'win32') return false; | ||||||
|  |  | ||||||
|   // make sure the action runs in the hosted environment |   // make sure the action runs in the hosted environment | ||||||
|   if ( |   if (isSelfHosted()) return false; | ||||||
|     process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' && |  | ||||||
|     process.env['AGENT_ISSELFHOSTED'] === '1' |  | ||||||
|   ) |  | ||||||
|     return false; |  | ||||||
|  |  | ||||||
|   const defaultToolCacheRoot = process.env['RUNNER_TOOL_CACHE']; |   const defaultToolCacheRoot = process.env['RUNNER_TOOL_CACHE']; | ||||||
|   if (!defaultToolCacheRoot) return false; |   if (!defaultToolCacheRoot) return false; | ||||||
| @@ -279,11 +275,46 @@ export async function extractGoArchive(archivePath: string): Promise<string> { | |||||||
|   return extPath; |   return extPath; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function isIToolRelease(obj: any): obj is tc.IToolRelease { | ||||||
|  |   return ( | ||||||
|  |     typeof obj === 'object' && | ||||||
|  |     obj !== null && | ||||||
|  |     typeof obj.version === 'string' && | ||||||
|  |     typeof obj.stable === 'boolean' && | ||||||
|  |     Array.isArray(obj.files) && | ||||||
|  |     obj.files.every( | ||||||
|  |       (file: any) => | ||||||
|  |         typeof file.filename === 'string' && | ||||||
|  |         typeof file.platform === 'string' && | ||||||
|  |         typeof file.arch === 'string' && | ||||||
|  |         typeof file.download_url === 'string' | ||||||
|  |     ) | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  |  | ||||||
| export async function getManifest( | export async function getManifest( | ||||||
|   auth: string | undefined |   auth: string | undefined | ||||||
| ): Promise<tc.IToolRelease[]> { | ): Promise<tc.IToolRelease[]> { | ||||||
|   try { |   try { | ||||||
|     return await getManifestFromRepo(auth); |     const manifest = await getManifestFromRepo(auth); | ||||||
|  |     if ( | ||||||
|  |       Array.isArray(manifest) && | ||||||
|  |       manifest.length && | ||||||
|  |       manifest.every(isIToolRelease) | ||||||
|  |     ) { | ||||||
|  |       return manifest; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     let errorMessage = | ||||||
|  |       'An unexpected error occurred while fetching the manifest.'; | ||||||
|  |     if ( | ||||||
|  |       typeof manifest === 'object' && | ||||||
|  |       manifest !== null && | ||||||
|  |       'message' in manifest | ||||||
|  |     ) { | ||||||
|  |       errorMessage = (manifest as {message: string}).message; | ||||||
|  |     } | ||||||
|  |     throw new Error(errorMessage); | ||||||
|   } catch (err) { |   } catch (err) { | ||||||
|     core.debug('Fetching the manifest via the API failed.'); |     core.debug('Fetching the manifest via the API failed.'); | ||||||
|     if (err instanceof Error) { |     if (err instanceof Error) { | ||||||
|   | |||||||
							
								
								
									
										10
									
								
								src/utils.ts
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/utils.ts
									
									
									
									
									
								
							| @@ -2,3 +2,13 @@ export enum StableReleaseAlias { | |||||||
|   Stable = 'stable', |   Stable = 'stable', | ||||||
|   OldStable = 'oldstable' |   OldStable = 'oldstable' | ||||||
| } | } | ||||||
|  |  | ||||||
|  | export const isSelfHosted = (): boolean => | ||||||
|  |   process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' && | ||||||
|  |   (process.env['AGENT_ISSELFHOSTED'] === '1' || | ||||||
|  |     process.env['AGENT_ISSELFHOSTED'] === undefined); | ||||||
|  | /* the above is simplified from: | ||||||
|  |     process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' && process.env['AGENT_ISSELFHOSTED'] === '1' | ||||||
|  |     || | ||||||
|  |     process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' && process.env['AGENT_ISSELFHOSTED'] === undefined | ||||||
|  | */ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user