mirror of
https://github.com/redhat-actions/buildah-build.git
synced 2025-06-08 18:09:04 +00:00
fix: add new flag
This commit is contained in:
parent
ad02cb8a12
commit
99beb78b03
4 changed files with 16 additions and 2 deletions
|
@ -130,6 +130,12 @@ export enum Inputs {
|
|||
* Default: None.
|
||||
*/
|
||||
WORKDIR = "workdir",
|
||||
/**
|
||||
* If you are running on self hosted runner, you can set this so it will add "sudo" to every buildah command if you dont want to run rootless. Defaults to false
|
||||
* Required: false
|
||||
* Default: "false"
|
||||
*/
|
||||
SELF_HOSTED_RUNNER_ROOT = "self-hosted-runner-root",
|
||||
}
|
||||
|
||||
export enum Outputs {
|
||||
|
|
|
@ -19,8 +19,10 @@ export async function run(): Promise<void> {
|
|||
}
|
||||
|
||||
// get buildah cli
|
||||
const self_hosted_runner = core.getInput(Inputs.SELF_HOSTED_RUNNER_ROOT)
|
||||
const buildahPath = await io.which("buildah", true);
|
||||
const cli: BuildahCli = new BuildahCli(`sudo ${buildahPath}`);
|
||||
const buildahExec = self_hosted_runner === "true" ? `sudo ${buildahPath}` : buildahPath;
|
||||
const cli: BuildahCli = new BuildahCli(buildahExec);
|
||||
|
||||
// print buildah version
|
||||
await cli.execute([ "version" ], { group: true });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue