Skip to content

Commit 876baea

Browse files
feat: Add option for repository auth
1 parent bc06100 commit 876baea

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
| `cache` | No | `true` | Whether to cache RPC responses or not. | bool |
3737
| `version` | No | `nightly` | Version to install, e.g. `nightly` or `1.0.0`. **Note:** Foundry only has nightly builds for the time being. | string |
3838
| `repository` | No | `https://github.com` | Artifact repository url prefix to download Foundry binaries from. It needs to be compliant with Github's path. | string |
39+
| `repository-auth` | No | `""` | HTTP Authorization header for the above repository. Not required for Github. | string |
3940

4041
### RPC Caching
4142

action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ inputs:
3030
The repo artifact path has to conform to the url format of github, like `${repository}/foundry-rs/foundry/releases/download/${version}/${fullFileName}`
3131
The default value is `https://github.com`.
3232
required: false
33+
repository-auth:
34+
default: ""
35+
description: |
36+
HTTP Authorization header for the above repository. Not required for Github.
37+
38+
Left empty by default.
39+
required: false
3340

3441
runs:
3542
using: "node16"

dist/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68386,11 +68386,12 @@ async function main() {
6838668386
const version = core.getInput("version");
6838768387
// Get artifact repository input
6838868388
const repository = core.getInput("repository");
68389+
const repositoryAuth = core.getInput("repository-auth");
6838968390

6839068391
// Download the archive containing the binaries
6839168392
const download = getDownloadObject(repository, version);
6839268393
core.info(`Downloading Foundry '${version}' from: ${download.url}`);
68393-
const pathToArchive = await toolCache.downloadTool(download.url);
68394+
const pathToArchive = await toolCache.downloadTool(download.url, '', repositoryAuth);
6839468395

6839568396
// Extract the archive onto host runner
6839668397
core.debug(`Extracting ${pathToArchive}`);

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ async function main() {
1111
const version = core.getInput("version");
1212
// Get artifact repository input
1313
const repository = core.getInput("repository");
14+
const repositoryAuth = core.getInput("repository-auth");
1415

1516
// Download the archive containing the binaries
1617
const download = getDownloadObject(repository, version);
1718
core.info(`Downloading Foundry '${version}' from: ${download.url}`);
18-
const pathToArchive = await toolCache.downloadTool(download.url);
19+
const pathToArchive = await toolCache.downloadTool(download.url, '', repositoryAuth);
1920

2021
// Extract the archive onto host runner
2122
core.debug(`Extracting ${pathToArchive}`);

0 commit comments

Comments
 (0)