Use XDG_RUNTIME_DIR if set for auth file path (#13)

Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
Divyanshu Agrawal 2021-10-20 00:19:25 +05:30 committed by GitHub
parent fc6abaf740
commit 63cb3e13a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -48,7 +48,11 @@ async function run(): Promise<void> {
// Setting REGISTRY_AUTH_FILE environment variable as buildah needs
// this environment variable to point to registry auth file
const podmanAuthFilePath = path.join("/", "tmp", `podman-run-${process.getuid()}`,
let authFileDir = path.join("/", "tmp", `podman-run-${process.getuid()}`);
if (process.env.XDG_RUNTIME_DIR) {
authFileDir = process.env.XDG_RUNTIME_DIR;
}
const podmanAuthFilePath = path.join(authFileDir,
"containers", "auth.json");
const REGISTRY_AUTH_ENVVAR = "REGISTRY_AUTH_FILE";
core.info(`Exporting ${REGISTRY_AUTH_ENVVAR}=${podmanAuthFilePath}`);