Skip to content

Commit

Permalink
feat: Add option for repository auth
Browse files Browse the repository at this point in the history
  • Loading branch information
frank-lim-partior committed Aug 28, 2023
1 parent bc06100 commit e9ac765
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
| `cache` | No | `true` | Whether to cache RPC responses or not. | bool |
| `version` | No | `nightly` | Version to install, e.g. `nightly` or `1.0.0`. **Note:** Foundry only has nightly builds for the time being. | string |
| `repository` | No | `https://github.com` | Artifact repository url prefix to download Foundry binaries from. It needs to be compliant with Github's path. | string |
| `repository-auth` | No | `""` | HTTP Authorization header for the above repository. Not required for Github. | string |

### RPC Caching

Expand Down
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ inputs:
The repo artifact path has to conform to the url format of github, like `${repository}/foundry-rs/foundry/releases/download/${version}/${fullFileName}`
The default value is `https://github.com`.
required: false
repository-auth:
default: ""
description: |
HTTP Authorization header for the above repository. Not required for Github.
Left empty by default.
required: false

runs:
using: "node16"
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ async function main() {
const version = core.getInput("version");
// Get artifact repository input
const repository = core.getInput("repository");
const repositoryAuth = core.getInput("repository-auth");

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

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

0 comments on commit e9ac765

Please sign in to comment.