Skip to content

Commit 3df2385

Browse files
committed
fix: Use GitHub personal access token to retrieve artifacts.
1 parent 03c4673 commit 3df2385

File tree

10 files changed

+43
-1316
lines changed

10 files changed

+43
-1316
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ jobs:
6262
x64-osx
6363
x64-linux
6464
version: nightly
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6567

6668
- name: Print Output
6769
id: output
68-
run: echo "${{ steps.test-action.outputs.time }}"
70+
run: |
71+
echo "${{ steps.test-action.outputs.path }}"

__tests__/main.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let setFailedMock: jest.SpiedFunction<typeof core.setFailed>
2222
let setOutputMock: jest.SpiedFunction<typeof core.setOutput>
2323

2424
let downloadToolMock: jest.SpiedFunction<typeof tc.downloadTool>
25-
let extract7z: jest.SpiedFunction<typeof tc.extract7z>
25+
let extractZipMock: jest.SpiedFunction<typeof tc.extractZip>
2626

2727
describe('action', () => {
2828
beforeEach(() => {
@@ -38,10 +38,10 @@ describe('action', () => {
3838
setOutputMock = jest.spyOn(core, 'setOutput').mockImplementation()
3939

4040
downloadToolMock = jest.spyOn(tc, 'downloadTool').mockImplementation()
41-
extract7z = jest.spyOn(tc, 'extract7z').mockImplementation()
41+
extractZipMock = jest.spyOn(tc, 'extractZip').mockImplementation()
4242

43-
downloadToolMock.mockImplementation(async () => 'path/to/sdk.7z')
44-
extract7z.mockImplementation(async () => 'path/to/sdk')
43+
downloadToolMock.mockImplementation(async () => 'path/to/sdk.zip')
44+
extractZipMock.mockImplementation(async () => 'path/to/sdk')
4545
})
4646

4747
it('downloads the nightly artifacts', async () => {
@@ -74,7 +74,7 @@ describe('action', () => {
7474
)
7575
expect(setOutputMock).toHaveBeenNthCalledWith(
7676
2,
77-
expect.stringContaining('_nightly'),
77+
'path',
7878
expect.stringContaining('sdk')
7979
)
8080
expect(errorMock).not.toHaveBeenCalled()

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ inputs:
1717
required: true
1818
default: 'nightly'
1919

20+
outputs:
21+
path:
22+
description: 'The path where the SDK has been installed'
23+
2024
runs:
2125
using: node20
2226
main: dist/index.js

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)