Skip to content

Improve support for running on push event#1

Open
andrewmcnamara wants to merge 2 commits into
mainfrom
improve-support-for-push-events
Open

Improve support for running on push event#1
andrewmcnamara wants to merge 2 commits into
mainfrom
improve-support-for-push-events

Conversation

@andrewmcnamara

@andrewmcnamara andrewmcnamara commented Oct 2, 2023

Copy link
Copy Markdown
Collaborator

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