Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve support for running on push event #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

andrewmcnamara
Copy link
Collaborator

@andrewmcnamara andrewmcnamara commented Oct 2, 2023

Improves support for push events. Original issue that has been closed unresolved

On initial PR creation the base_ref is null .

{
  "after": "41da3d31e13c738899d9b167156d4[22](https://github.com/andrewmcnamara/jacoco-playground/actions/runs/6347324298/job/17242166029#step:7:23)875194b15",
  "base_ref": null,
  "before": "0000000000000000000000000000000000000000",
 
} 
  

This causes client.rest.repos.compareCommits in getChangedFiles to fail with HttpError: Not Found as the base ref is not found.

This PR surrounds this call with a try/catch and additionally makes an assumption that what you really want is to compare against your default branch. Which is correct in most cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant