diff --git a/parse_commit_args.js b/parse_commit_args.js index 40fc40a..41b4186 100644 --- a/parse_commit_args.js +++ b/parse_commit_args.js @@ -48,10 +48,12 @@ async function get_commits(context = null) { /** * @type {[Object]} */ - const all_commits = await get_json_request(commits_url, null, { + let all_commits = await get_json_request(commits_url, null, { 'User-Agent': 'parse-commit-args-action', }) + all_commits = Array.isArray(all_commits) ? all_commits : [all_commits] + return all_commits.map((c) => c.commit) } diff --git a/parse_commit_args.test.js b/parse_commit_args.test.js index b3c7268..557c936 100644 --- a/parse_commit_args.test.js +++ b/parse_commit_args.test.js @@ -6,6 +6,7 @@ async function test_context(context) { } async function main() { + await test_context(require('./.local/example_release_context.json')) await test_context(require('./.local/example_push_context.json')) await test_context(require('./.local/example_pr_context.json')) }