Skip to content

Commit

Permalink
fix: Use GitHub personal access token to retrieve artifacts.
Browse files Browse the repository at this point in the history
  • Loading branch information
na2axl committed Oct 6, 2024
1 parent 03c4673 commit 45115f3
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 1,316 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ jobs:
x64-osx
x64-linux
version: nightly
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Print Output
id: output
run: echo "${{ steps.test-action.outputs.time }}"
run: |
echo "${{ steps.test-action.outputs.path }}"
ls -asl ${{ steps.test-action.outputs.path }}
10 changes: 5 additions & 5 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let setFailedMock: jest.SpiedFunction<typeof core.setFailed>
let setOutputMock: jest.SpiedFunction<typeof core.setOutput>

let downloadToolMock: jest.SpiedFunction<typeof tc.downloadTool>
let extract7z: jest.SpiedFunction<typeof tc.extract7z>
let extractZipMock: jest.SpiedFunction<typeof tc.extractZip>

describe('action', () => {
beforeEach(() => {
Expand All @@ -38,10 +38,10 @@ describe('action', () => {
setOutputMock = jest.spyOn(core, 'setOutput').mockImplementation()

downloadToolMock = jest.spyOn(tc, 'downloadTool').mockImplementation()
extract7z = jest.spyOn(tc, 'extract7z').mockImplementation()
extractZipMock = jest.spyOn(tc, 'extractZip').mockImplementation()

downloadToolMock.mockImplementation(async () => 'path/to/sdk.7z')
extract7z.mockImplementation(async () => 'path/to/sdk')
downloadToolMock.mockImplementation(async () => 'path/to/sdk.zip')
extractZipMock.mockImplementation(async () => 'path/to/sdk')
})

it('downloads the nightly artifacts', async () => {
Expand Down Expand Up @@ -74,7 +74,7 @@ describe('action', () => {
)
expect(setOutputMock).toHaveBeenNthCalledWith(
2,
expect.stringContaining('_nightly'),
'path',
expect.stringContaining('sdk')
)
expect(errorMock).not.toHaveBeenCalled()
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ inputs:
required: true
default: 'nightly'

outputs:
path:
description: 'The path where the SDK has been installed'

runs:
using: node20
main: dist/index.js
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 45115f3

Please sign in to comment.