Skip to content

Github event pull_request.closed fails in case deleted branch after merge #1155

Open
@chvima

Description

@chvima

We have Github repo setup to delete every feature branch on merge to main.
(Settings, General)
image

Digger is processing an github event pull_request.closed after which I assume it runs digger unlock by default (as in docs https://docs.digger.dev/reference/digger.yml#default-workflow )
image

However, based on the logs, it looks like it is still trying to fetch digger config from the feature branch instead of the one it was merged to. In our case this branch no longer exists at that point, which results in error:

 2024/02/14 12:05:29 github.go:50: PlainClone error: couldn't find remote ref "refs/heads/PLAT-17383-digger-mosaic-dev"                                                                                   │
│ 2024/02/14 12:05:29 github.go:519: Error generating projects: couldn't find remote ref "refs/heads/PLAT-17383-digger-mosaic-dev"                                                                         │
│ 2024/02/14 12:05:29 github.go:419: getDiggerConfig error: error generating projects                                                                                                                      │
│ 2024/02/14 12:05:29 github.go:103: handlePullRequestEvent error: error getting digger config

When I turned off automatic branch deletion in our github repo config, the problem no longer appears, but it's not a setup we would like to use:

image

Issue this causes for us - apply on merge is not triggered if github is setup to automatically delete branches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions