Skip to content

Commit

Permalink
Improve experience when init fails before generating a config file
Browse files Browse the repository at this point in the history
Suppose a customer has a run where the init Action failed before saving
a config file.
When the customer opens their Actions logs, the UI currently focuses on
the post init step, since this is the last step that failed.
Demoting the error in the post init Action to a warning means that the
UI will instead focus on the `init` step, which is more useful for
debugging what went wrong.
  • Loading branch information
henrymercer committed Nov 7, 2022
1 parent 8aff97f commit f9948ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/init-action-post-helper.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/init-action-post-helper.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/init-action-post-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export async function run(

const config = await getConfig(actionsUtil.getTemporaryDirectory(), logger);
if (config === undefined) {
throw new Error(
"Config file could not be found at expected location. Did the 'init' action fail to start?"
logger.warning(
"Debugging artifacts are unavailable since the 'init' Action failed before it could produce any."
);
}

Expand Down

0 comments on commit f9948ff

Please sign in to comment.