fix: uptag
This commit is contained in:
parent
f4a8edebcf
commit
37b5fb702d
2 changed files with 3 additions and 4 deletions
|
@ -45,10 +45,10 @@ runs:
|
||||||
|
|
||||||
echo "Using tag: $TAG"
|
echo "Using tag: $TAG"
|
||||||
|
|
||||||
export CD_WORKING_DIR=$PWD
|
export CD_WORKING_DIR="$PWD"
|
||||||
cd $GITHUB_ACTION_PATH
|
cd $GITHUB_ACTION_PATH
|
||||||
yarn node index.js
|
yarn node index.js
|
||||||
cd $CD_WORKING_DIR
|
cd "$CD_WORKING_DIR"
|
||||||
|
|
||||||
git config user.name "forgejo-actions"
|
git config user.name "forgejo-actions"
|
||||||
git config user.email "bot@devthefuture.org"
|
git config user.email "bot@devthefuture.org"
|
||||||
|
|
|
@ -35,7 +35,6 @@ const main = async () => {
|
||||||
const cdEnv = process.env.CD_ENV;
|
const cdEnv = process.env.CD_ENV;
|
||||||
const cdKey = process.env.CD_KEY;
|
const cdKey = process.env.CD_KEY;
|
||||||
const workingDir = process.env.CD_WORKING_DIR;
|
const workingDir = process.env.CD_WORKING_DIR;
|
||||||
process.cwd(workingDir);
|
|
||||||
let apps;
|
let apps;
|
||||||
if (cdApp.includes("\n")) {
|
if (cdApp.includes("\n")) {
|
||||||
apps = yamlLoadAll(cdApp);
|
apps = yamlLoadAll(cdApp);
|
||||||
|
@ -48,7 +47,7 @@ const main = async () => {
|
||||||
const { name, key = cdKey, tag = defaultTag } = app;
|
const { name, key = cdKey, tag = defaultTag } = app;
|
||||||
const valuesFile = `apps/${name}/envs/${env}/values.yaml`;
|
const valuesFile = `apps/${name}/envs/${env}/values.yaml`;
|
||||||
console.log(`${valuesFile} -> ${key}=${tag}`);
|
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);
|
const values = yaml.parse(valuesRaw);
|
||||||
set(values, key, tag);
|
set(values, key, tag);
|
||||||
await fs.writeFile(yaml.stringify(values), { encoding: "utf-8" });
|
await fs.writeFile(yaml.stringify(values), { encoding: "utf-8" });
|
||||||
|
|
Loading…
Add table
Reference in a new issue