WIP: Build & Release

This commit is contained in:
Michał Zieliński
2025-02-12 18:25:04 +01:00
parent fc5980c83d
commit 2308c25a5c

View File

@@ -16,13 +16,14 @@ module.exports = async ({ github, context, core, jobId }) => {
const regex = /#{(.*?)}/g;
let match;
while (match = regex.exec(data)) {
const original = match[0];
const token = match[1].replace(/-/g, '_').toUpperCase();
const value = getValue(token, jobId);
if (!value) {
core.setFailed(`Token ${token} not found`);
return false;
}
const result = data.replace(new RegExp(`#{${token}}`, 'g'), value);
const result = data.replace(new RegExp(`#{${original}}`, 'g'), value);
require('fs').writeFileSync(file, result, 'utf8');
}
});