Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/__tests__/execute.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ describe('execute', () => {
expect(github.getOctokit).toBeCalledWith(inputs.personalToken, { baseUrl: githubUrl });
});

it('aborts execution when no entries are found', async () => {
getEntries.mockResolvedValueOnce([]);
const results = await execute(inputs);
expect(results).toBeNull();
expect(getEntries).toBeCalled();
expect(publish).not.toBeCalled();
});

describe('Sponsorship', () => {
it('checks if the user is a sponsor', async () => {
checkSponsorship.mockResolvedValueOnce(true);
Expand Down
5 changes: 5 additions & 0 deletions src/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ const run = async ({ inputs, octokit }) => {
});
core.debug(`Analyzed entries: ${entries.length}`);

if (entries.length === 0) {
core.info('No reviews found for the specified period.');
return null;
}

await publish({
core,
octokit,
Expand Down