diff --git a/.github/workflows/test-workflow.yaml b/.github/workflows/test-workflow.yaml index 3631d56..a0f46b7 100644 --- a/.github/workflows/test-workflow.yaml +++ b/.github/workflows/test-workflow.yaml @@ -6,6 +6,9 @@ on: branches: - '*' +permissions: + contents: read + jobs: test-action: strategy: diff --git a/action/dist/index.js b/action/dist/index.js index 291a753..11c946a 100644 --- a/action/dist/index.js +++ b/action/dist/index.js @@ -30725,6 +30725,11 @@ async function getDownloadURL(version) { core.info(`Platform: ${platform}`) core.info(`Arch: ${arch}`) + // https://github.com/vechain/networkhub/releases/download/v0.0.3/network-hub-macos-arm64 + + // https://github.com/vechain/networkhub/releases/download/v0.0.3/network-hub-macos-arm64 + + const url = `https://github.com/vechain/networkhub/releases/download/${version}/network-hub-${platform}-${arch}${process.platform === 'win32' ? '.exe' : ''}`; core.info(`Download URL: ${url}`) return url; @@ -30742,8 +30747,16 @@ async function setup() { core.info(`Installing networkHub version ${version}`) + //create an auth header using the token provided + const token = core.getInput('token'); + if (!token) { + core.setFailed('No token specified') + return + } // Download the specific version of the tool, e.g. as a tarball - const pathToCLI = await tc.downloadTool(await getDownloadURL(version)); + const pathToCLI = await tc.downloadTool(await getDownloadURL(version), undefined, undefined, { + authorization: `Bearer ${token}` + }); // Expose the tool by adding it to the PATH core.addPath(pathToCLI) diff --git a/action/src/index.js b/action/src/index.js index 17786da..1b77f86 100644 --- a/action/src/index.js +++ b/action/src/index.js @@ -39,6 +39,11 @@ async function getDownloadURL(version) { core.info(`Platform: ${platform}`) core.info(`Arch: ${arch}`) + // https://github.com/vechain/networkhub/releases/download/v0.0.3/network-hub-macos-arm64 + + // https://github.com/vechain/networkhub/releases/download/v0.0.3/network-hub-macos-arm64 + + const url = `https://github.com/vechain/networkhub/releases/download/${version}/network-hub-${platform}-${arch}${process.platform === 'win32' ? '.exe' : ''}`; core.info(`Download URL: ${url}`) return url; @@ -56,8 +61,16 @@ async function setup() { core.info(`Installing networkHub version ${version}`) + //create an auth header using the token provided + const token = core.getInput('token'); + if (!token) { + core.setFailed('No token specified') + return + } // Download the specific version of the tool, e.g. as a tarball - const pathToCLI = await tc.downloadTool(await getDownloadURL(version)); + const pathToCLI = await tc.downloadTool(await getDownloadURL(version), undefined, undefined, { + authorization: `Bearer ${token}` + }); // Expose the tool by adding it to the PATH core.addPath(pathToCLI)