Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions actions/setup/js/generate_aw_info.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @ts-check
/// <reference types="@actions/github-script" />

const fs = require("fs");
const { TMP_GH_AW_PATH } = require("./constants.cjs");
const { generateWorkflowOverview } = require("./generate_workflow_overview.cjs");

Expand All @@ -16,12 +17,10 @@ const { generateWorkflowOverview } = require("./generate_workflow_overview.cjs")
* @returns {Promise<void>}
*/
async function main(core, ctx) {
const fs = require("fs");

// Validate required context variables
const requiredContextFields = ["runId", "runNumber", "sha", "ref", "actor", "eventName", "repo"];
for (const field of requiredContextFields) {
if (ctx[field] === undefined || ctx[field] === null) {
if (ctx[field] == null) {
core.warning(`GitHub Actions context.${field} is not set`);
}
}
Expand Down Expand Up @@ -75,8 +74,8 @@ async function main(core, ctx) {
fs.mkdirSync(TMP_GH_AW_PATH, { recursive: true });
const tmpPath = TMP_GH_AW_PATH + "/aw_info.json";
fs.writeFileSync(tmpPath, JSON.stringify(awInfo, null, 2));
console.log("Generated aw_info.json at:", tmpPath);
console.log(JSON.stringify(awInfo, null, 2));
core.info("Generated aw_info.json at: " + tmpPath);
core.info(JSON.stringify(awInfo, null, 2));

// Set model as output for reuse in other steps/jobs
core.setOutput("model", awInfo.model);
Expand Down
Loading