WIP: Build & Release

This commit is contained in:
Michał Zieliński
2025-02-12 18:36:52 +01:00
parent ca92c8d4d0
commit 6b8e3ecb32

View File

@@ -15,7 +15,7 @@ module.exports = async ({ github, context, core, jobId }) => {
files.forEach(file => {
let data = require('fs').readFileSync(file, 'utf8');
const regex = /#{(.*?)}/g;
const regex = /#{(.*?)}#/g;
let match;
while (match = regex.exec(data)) {
const original = match[0];
@@ -25,8 +25,9 @@ module.exports = async ({ github, context, core, jobId }) => {
core.setFailed(`Token ${token} not found`);
return false;
}
data = data.replace(new RegExp(`#{${original}}`, 'g'), value);
data = data.replace(new RegExp(`#{${original}}#`, 'g'), value);
console.log(`Replaced ${original} with ${value} (${token}) in ${file}`);
console.log(data);
}
console.log(data);
require('fs').writeFileSync(file, data, 'utf8');