mirror of
https://github.com/grafana/grafana.git
synced 2025-09-23 12:23:00 +08:00
Chore: change triggering of the detect-breaking-changes Github flow (#43188)
* chore: only run the breaking-changes flow on pull requests * chore: run the detect-breaking-changes flow on opening a PR * chore: use * Wip * Wip * Wip * Wip * Wip * Wip * Wip * Wip * Wip * Wip * Wip * Wip * Wip * Wip * Wip * Wip * Wip * trying to get workflow split running. * trying to trigger workflow. * trying to trigger. * Splits levitate job into two workflows. Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
This commit is contained in:
27
.github/workflows/scripts/json-file-to-job-output.js
vendored
Normal file
27
.github/workflows/scripts/json-file-to-job-output.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
module.exports = async ({ core, filePath }) => {
|
||||
try {
|
||||
const fs = require('fs');
|
||||
const content = await readFile(fs, filePath);
|
||||
const result = JSON.parse(content);
|
||||
|
||||
core.startGroup('Parsing json file...');
|
||||
|
||||
for (const property in result) {
|
||||
core.info(`${property} <- ${result[property]}`);
|
||||
core.setOutput(property, result[property]);
|
||||
}
|
||||
|
||||
core.endGroup();
|
||||
} catch (error) {
|
||||
core.restFailed(error.message);
|
||||
}
|
||||
}
|
||||
|
||||
async function readFile(fs, path) {
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.readFile(path, (error, data) => {
|
||||
if (error) return reject(error);
|
||||
return resolve(data);
|
||||
});
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user