Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip Install Tools #45

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ 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.

#### `skip-install-tools` (optional)
A boolean value to install foreman without downloading any tools

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.
18 changes: 9 additions & 9 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: 'Setup Foreman'
description: 'Install Foreman, a toolchain manager for Roblox projects'
author: 'The Rojo Developers'
name: "Setup Foreman"
description: "Install Foreman, a toolchain manager for Roblox projects"
author: "The Rojo Developers"
inputs:
version:
required: false
description: 'SemVer version of Foreman to install'
description: "SemVer version of Foreman to install"
working-directory:
required: false
description: 'Working directory to run `foreman install` in'
description: "Working directory to run `foreman install` in"
token:
required: true
description: 'GitHub token from secrets.GITHUB_TOKEN'
required: false
description: "GitHub token from secrets.GITHUB_TOKEN"
runs:
using: 'node16'
main: 'dist/index.js'
using: "node16"
main: "dist/index.js"
26 changes: 15 additions & 11 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async function run(): Promise<void> {
const allowExternalGithubOrgs: string = getInput(
"allow-external-github-orgs"
).toLowerCase();

const skipInstallTools: string = getInput("skip-install-tools");

const octokit = new GitHub(githubToken);
const releases = await foreman.getReleases(octokit);
Expand Down Expand Up @@ -53,18 +53,22 @@ async function run(): Promise<void> {
process.chdir(workingDir);
}

if (allowExternalGithubOrgs != "true") {
debug("Checking tools in Foreman Config come from source org");
const owner = process.env.GITHUB_REPOSITORY_OWNER;
if (owner == undefined) {
throw new Error(
`Could not find repository owner setup-foreman is running in`
);
if (skipInstallTools != "true") {

if (allowExternalGithubOrgs != "true") {
debug("Checking tools in Foreman Config come from source org");
const owner = process.env.GITHUB_REPOSITORY_OWNER;
if (owner == undefined) {
throw new Error(
`Could not find repository owner setup-foreman is running in`
);
}
configFile.checkSameOrgInConfig(owner.toLowerCase());
}
configFile.checkSameOrgInConfig(owner.toLowerCase());
}

await foreman.installTools();

await foreman.installTools();
}
} catch (error) {
if (error instanceof Error) {
setFailed(error.message);
Expand Down
Loading