Skip to content

Commit

Permalink
[ci] Make sure scheduled workflow run with build_all
Browse files Browse the repository at this point in the history
  • Loading branch information
Megane Millan committed Oct 15, 2024
1 parent 3aef341 commit 0144599
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions .github/workflows/scripts/get_compilation_flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,8 @@ module.exports = async ({github, context, core}) => {

const prNumber = context.issue.number || getPullRequestNumber(context.ref);

let cmakeFlags = '';
if(isNaN(prNumber))
{
core.setOutput("cmakeFlags", cmakeFlags);
return;
}

const { data } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
});
const labelNames = data.labels.map(label => label.name);

let cmakeFlags = '';// get os process is run on
const os = process.env.RUNNER_OS;

var labelFlags;
if(os == "Windows")
{
Expand Down Expand Up @@ -77,6 +63,29 @@ module.exports = async ({github, context, core}) => {
};
}

// Get the GitHub event name that triggered the workflow
const eventName = process.env.GITHUB_EVENT_NAME;
if (eventName === "schedule")
{
cmakeFlags += labelFlags['build_all'].join(' ');
console.log(cmakeFlags);
core.setOutput("cmakeFlags", cmakeFlags);
return;
}

if(isNaN(prNumber))
{
core.setOutput("cmakeFlags", cmakeFlags);
return;
}

const { data } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
});
const labelNames = data.labels.map(label => label.name);

labelNames.forEach(label => {
if (labelFlags[label]) {
if (Array.isArray(labelFlags[label])) {
Expand Down

0 comments on commit 0144599

Please sign in to comment.