Write a warning if there is an error with the workflow

This commit is contained in:
Simon Engledew 2020-11-24 09:51:00 +00:00
parent 7eb9dfcc60
commit 33bb87523e
No known key found for this signature in database
GPG key ID: 84302E7B02FE8BCE
9 changed files with 92 additions and 61 deletions

9
lib/init-action.js generated
View file

@ -55,7 +55,14 @@ async function run() {
let toolsVersion;
try {
actionsUtil.prepareLocalRunEnvironment();
if (!(await actionsUtil.sendStatusReport(await actionsUtil.createStatusReportBase("init", "starting", startedAt)))) {
const workflowErrors = actionsUtil.validateWorkflow(await actionsUtil.getWorkflow());
const workflowErrorMessage = workflowErrors.length > 0
? `${workflowErrors.length} issue${workflowErrors.length === 1 ? " was" : "s were"} detected with this workflow: ${workflowErrors.join(", ")}`
: undefined;
if (workflowErrorMessage !== undefined) {
core.warning(workflowErrorMessage);
}
if (!(await actionsUtil.sendStatusReport(await actionsUtil.createStatusReportBase("init", "starting", startedAt, workflowErrorMessage)))) {
return;
}
const initCodeQLResult = await init_1.initCodeQL(actionsUtil.getOptionalInput("tools"), actionsUtil.getRequiredInput("token"), actionsUtil.getRequiredEnvParam("GITHUB_SERVER_URL"), actionsUtil.getRequiredEnvParam("RUNNER_TEMP"), actionsUtil.getRequiredEnvParam("RUNNER_TOOL_CACHE"), "actions", logger);