mirror of
https://github.com/redhat-actions/podman-login.git
synced 2025-05-07 12:39:53 +02:00
Set env var REGISTRY_AUTH_FILE to work with buildah (#6)
* Set env var REGISTRY_AUTH_FILE to work with buildah Signed-off-by: divyansh42 <diagrawa@redhat.com> * Add info level message Signed-off-by: divyansh42 <diagrawa@redhat.com> * Resolve reviews Signed-off-by: divyansh42 <diagrawa@redhat.com> * Reslve reviews Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
parent
4bf4190336
commit
d968d572fb
7 changed files with 46 additions and 10 deletions
|
@ -6,6 +6,7 @@
|
|||
import * as core from "@actions/core";
|
||||
import * as io from "@actions/io";
|
||||
import * as os from "os";
|
||||
import * as path from "path";
|
||||
import { getInputs } from "./context";
|
||||
import { execute } from "./utils";
|
||||
import * as stateHelper from "./state-helper";
|
||||
|
@ -44,6 +45,14 @@ async function run(): Promise<void> {
|
|||
|
||||
await execute(await getPodmanPath(), args);
|
||||
core.info(`✅ Successfully logged in to ${registry} as ${username}`);
|
||||
|
||||
// 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()}`,
|
||||
"containers", "auth.json");
|
||||
const REGISTRY_AUTH_ENVVAR = "REGISTRY_AUTH_FILE";
|
||||
core.info(`Exporting ${REGISTRY_AUTH_ENVVAR}=${podmanAuthFilePath}`);
|
||||
core.exportVariable(REGISTRY_AUTH_ENVVAR, podmanAuthFilePath);
|
||||
}
|
||||
|
||||
async function registryLogout(): Promise<void> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue