WIP: Build & Release

This commit is contained in:
Michał Zieliński
2025-02-12 17:55:28 +01:00
parent cd0dd126fc
commit d43bc2d7a9

View File

@@ -18,13 +18,18 @@ module.exports = async ({ github, context, core, jobId }) => {
while (match = regex.exec(data)) { while (match = regex.exec(data)) {
const token = match[1].replace(/-/g, '_').toUpperCase(); const token = match[1].replace(/-/g, '_').toUpperCase();
console.log(token); console.log(token);
const value = getValue(token); const value = getValue(token, jobId);
console.log(value); console.log(value);
if (!value) {
core.setFailed(`Token ${token} not found`);
return false;
}
} }
}); });
} }
function getValue(token) { function getValue(token, jobId) {
if (token == 'BUILDID') { return jobId; }
const secrets = JSON.parse(process.env.SECRETS); const secrets = JSON.parse(process.env.SECRETS);
const variables = JSON.parse(process.env.VARIABLES); const variables = JSON.parse(process.env.VARIABLES);
return variables[token] || secrets[token]; return variables[token] || secrets[token];