fix: uptag

This commit is contained in:
devthejo 2023-12-20 22:56:37 +01:00
parent f4a8edebcf
commit 37b5fb702d
Signed by: devthejo
GPG key ID: C04215C627711F5C
2 changed files with 3 additions and 4 deletions

View file

@ -45,10 +45,10 @@ runs:
echo "Using tag: $TAG"
export CD_WORKING_DIR=$PWD
export CD_WORKING_DIR="$PWD"
cd $GITHUB_ACTION_PATH
yarn node index.js
cd $CD_WORKING_DIR
cd "$CD_WORKING_DIR"
git config user.name "forgejo-actions"
git config user.email "bot@devthefuture.org"

View file

@ -35,7 +35,6 @@ const main = async () => {
const cdEnv = process.env.CD_ENV;
const cdKey = process.env.CD_KEY;
const workingDir = process.env.CD_WORKING_DIR;
process.cwd(workingDir);
let apps;
if (cdApp.includes("\n")) {
apps = yamlLoadAll(cdApp);
@ -48,7 +47,7 @@ const main = async () => {
const { name, key = cdKey, tag = defaultTag } = app;
const valuesFile = `apps/${name}/envs/${env}/values.yaml`;
console.log(`${valuesFile} -> ${key}=${tag}`);
const valuesRaw = await fs.readFile(valuesFile, { encoding: "utf-8" })
const valuesRaw = await fs.readFile(`${workingDir}/valuesFile`, { encoding: "utf-8" })
const values = yaml.parse(valuesRaw);
set(values, key, tag);
await fs.writeFile(yaml.stringify(values), { encoding: "utf-8" });