Skip to content

Commit

Permalink
Handle missing config files
Browse files Browse the repository at this point in the history
  • Loading branch information
thehanimo committed Sep 10, 2021
1 parent bd02d06 commit 761b06d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ async function run() {
const title = github.context.payload.pull_request.title;
const labels = github.context.payload.pull_request.labels;

let a = await getJSON(configPath);
let a;
try {
a = await getJSON(configPath);
} catch (e) {
core.setFailed("Couldn't retrieve the config file specified - " + e);
return;
}
let { CHECKS, LABEL } = JSON.parse(a);
LABEL.name = LABEL.name || "title needs formatting";
LABEL.color = LABEL.color || "eee";
Expand Down

0 comments on commit 761b06d

Please sign in to comment.