WIP: Build & Release

This commit is contained in:
Michał Zieliński
2025-02-12 18:07:21 +01:00
parent c6736cd01d
commit c7188a34fa
3 changed files with 31 additions and 6 deletions

View File

@@ -17,14 +17,11 @@ module.exports = async ({ github, context, core, jobId }) => {
let match;
while (match = regex.exec(data)) {
const token = match[1].replace(/-/g, '_').toUpperCase();
console.log(token);
const value = getValue(token, jobId);
console.log(value);
if (!value) {
core.setFailed(`Token ${token} not found`);
return false;
}
// replace all occurrences of the ${token} with the value in file
const result = data.replace(new RegExp(`#{${token}}`, 'g'), value);
require('fs').writeFileSync(file, result, 'utf8');
}