Im trying to make a git clone with a auth token but i cant get it to work with the secret var. It is not populated or some how mis formated I think because the command fails with the error invalid password
code:
const ghSecret = client.setSecret("ghApiToken", token);
const container = client
.container()
.from(BASE_IMAGE)
.withWorkdir(workDir)
// .withExec(["apt-get", "install", "-y", "git"])
.withSecretVariable("GITHUB_TOKEN", ghSecret)
.withExec(
cloneCommand({ token: "$GITHUB_TOKEN", git: git, branch: branch })
)
.withExec(["npm", "i"])
.withEntrypoint(["npm", "start"]);
cloneCommand:
export default function cloneCommand({
token,
git,
branch,
}: {
token: string;
git: string;
branch: string;
}) {
const command = [
"git",
"clone",
`https://x-access-token:${token}@github.com/${git}.git`,
"-b",
branch,
".",
];
console.log(command.join(" "));
return command;
}
What am I missing? Or how can I debug this?
Thx for your help ๐