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

Duplicate CI pipeline jobs #5813

Open
sebastianbergmann opened this issue Apr 12, 2024 · 2 comments
Open

Duplicate CI pipeline jobs #5813

sebastianbergmann opened this issue Apr 12, 2024 · 2 comments
Labels
type/build-automation Issues related to PHPUnit's build automation (GitHub Actions, etc.)

Comments

@sebastianbergmann
Copy link
Owner

When I push to a branch in this repository which is used in a pull request in this repository then the CI pipeline is run twice: once triggered by the push event and once triggered by the pull_request event:

grafik

It would be nice if the CI pipeline would only be run once in this case. If this is possible at all then we should only build for pull_request (so that the information in the pull request is updated) and not for push.

@sebastianbergmann sebastianbergmann added the type/build-automation Issues related to PHPUnit's build automation (GitHub Actions, etc.) label Apr 12, 2024
@talkinnl
Copy link

talkinnl commented Apr 13, 2024

  push:
    branches:
      - 'main'
      - 'releases/**'

Example syntax to restrict the push workflow.

I can make a PR for this. :)

@talkinnl
Copy link

talkinnl commented Apr 18, 2024

I thought of this:

on:
  pull_request:
    branches:
      - main
      - "[0-9]*"
  push:
  schedule:
    - cron: "15 0 * * *"

i.e. add a branch restriction for main or any of your branches starting with version number.

But this won't work, as I see internal branches with arbitrary patterns.

I see a hack at https://stackoverflow.com/a/65946732 , but I don't like that.

So I guess it's actually not that easy? Not de-duplicating on the commit hash seems just wasteful of Github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/build-automation Issues related to PHPUnit's build automation (GitHub Actions, etc.)
Projects
None yet
Development

No branches or pull requests

2 participants