mirror of
https://github.com/redhat-actions/podman-login.git
synced 2025-02-23 02:21:22 +01:00
Use XDG_RUNTIME_DIR if set for auth file path (#13)
Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
parent
fc6abaf740
commit
63cb3e13a4
3 changed files with 7 additions and 3 deletions
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -48,7 +48,11 @@ async function run(): Promise<void> {
|
||||||
|
|
||||||
// Setting REGISTRY_AUTH_FILE environment variable as buildah needs
|
// Setting REGISTRY_AUTH_FILE environment variable as buildah needs
|
||||||
// this environment variable to point to registry auth file
|
// 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");
|
"containers", "auth.json");
|
||||||
const REGISTRY_AUTH_ENVVAR = "REGISTRY_AUTH_FILE";
|
const REGISTRY_AUTH_ENVVAR = "REGISTRY_AUTH_FILE";
|
||||||
core.info(`Exporting ${REGISTRY_AUTH_ENVVAR}=${podmanAuthFilePath}`);
|
core.info(`Exporting ${REGISTRY_AUTH_ENVVAR}=${podmanAuthFilePath}`);
|
||||||
|
|
Loading…
Add table
Reference in a new issue