From 4422f2ff5a81668581d4efd17b054ae6645ceefd Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Sat, 6 Feb 2021 12:45:55 +1100 Subject: [PATCH] fix manual actions Manually running actions that add contributors fails. This should fix that. --- .github/scripts/contributors.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/scripts/contributors.js b/.github/scripts/contributors.js index 54d1481..1d2ba61 100644 --- a/.github/scripts/contributors.js +++ b/.github/scripts/contributors.js @@ -8,7 +8,9 @@ var eventJson = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, {encod $('#contributors-list').empty() // remove all names to start clean for (let name of contributors) { - if (name.length > 0) { + // check the name isn't empty and there are commits + // if this is run manually there won't be any commits + if (name.length > 0 && eventJson.commits) { for (let commit of eventJson.commits) { // we only look for authors, not commiters, so we automatically ignore "actions-user" if ( !contributors.includes(commit.author.name) ) {