tibdex / backport

🔙 GitHub Action to backport pull requests
MIT License
73 stars 65 forks source link

Backport PRs created with this action trigger pull_request labelled event not pull_request #104

Open pmalek opened 1 year ago

pmalek commented 1 year ago

Problem statement

We have a CI that is configured to run on pull_request events on all branches: https://github.com/Kong/kubernetes-ingress-controller/blob/beac200706f81b9420d21b00653fd59a4040f8bb/.github/workflows/pr_checks.yaml#L12-L14.

Given an exemplar PR https://github.com/Kong/kubernetes-ingress-controller/pull/4128 that got a label to be backported to release/2.10.x branch we received this PR https://github.com/Kong/kubernetes-ingress-controller/pull/4131 which triggered only pull request labelled event not pull_request as it should. Hence we didn't get a full CI run as we'd like to: https://github.com/Kong/kubernetes-ingress-controller/actions?query=branch%3Abackport-4128-to-release%2F2.10.x

image

Expected behavior

PRs created by this action trigger pull_request event so that a full CI run can be triggered.

pmalek commented 1 year ago

Looking at the https://github.com/tibdex/backport/blob/main/src/backport.ts#L113-L134 it does seem to do the correct thing (using https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#create-a-pull-request to create the PR) although I'm not sure if the timing of creating and labelling the PR isn't an issue here 🤔

Maybe labelling so quickly after creating prevents the creation event from going out.