In lib/util.js when determining the modified files from a push event, now uses octokit's getCommit method instead of compareCommitsWithBasehead to avoid errors when the push event does not include a "before" commit and only an "after" commit.
The getCommit method only includes files that were part of the commit, so it naturally identifies the files that would be part of the diff when compared to the immediately prior commit.
In tests/util.test.js, pulls test token from environment variable TEST_GITHUB_TOKEN to mitigate accidentally committing it (like I did in my prior PR)
Fixes #128
Changes
lib/util.js
when determining the modified files from a push event, now uses octokit'sgetCommit
method instead ofcompareCommitsWithBasehead
to avoid errors when the push event does not include a "before" commit and only an "after" commit.getCommit
method only includes files that were part of the commit, so it naturally identifies the files that would be part of the diff when compared to the immediately prior commit.tests/util.test.js
, pulls test token from environment variableTEST_GITHUB_TOKEN
to mitigate accidentally committing it (like I did in my prior PR)npm run all
Tests