Skip to content

Commit

Permalink
Support API url override
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostnaps committed Dec 18, 2023
1 parent fca1151 commit 58d328b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ If not specified the root job folder will be used.
#### `allow-external-github-orgs` (optional)
A boolean value to allow external github orgs in the foreman manifest file.

#### `github-api-url` (optional)

Override for the GitHub API URL. By default GitHub Actions will supply this
value as the current environment, which will usually be
`https://api.github.com`.

You shouldn't need to change unless working in GitHub Enterprise or a similar
self-hosted environment.

If not specified, external github orgs will not be allowed.
## License
setup-foreman is available under the MIT license. See [LICENSE.txt](LICENSE.txt) or <https://opensource.org/licenses/MIT> for details.
5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ async function run(): Promise<void> {
const versionReq: string = getInput("version");
const githubToken: string = getInput("token");
const workingDir: string = getInput("working-directory");
const githubApiUrl: string = getInput("github-api-url");
const allowExternalGithubOrgs: string = getInput(
"allow-external-github-orgs"
).toLowerCase();

const octokit = new GitHub(githubToken);
const octokit = new GitHub(githubToken, {
baseUrl: githubApiUrl
});
const releases = await foreman.getReleases(octokit);
const validReleases = foreman.filterValidReleases(releases)
debug("Choosing release from GitHub API");
Expand Down

0 comments on commit 58d328b

Please sign in to comment.