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

Github actions workflow runs twice for PR'd in-repo branches #55

Open
ZLLentz opened this issue Oct 7, 2024 · 2 comments
Open

Github actions workflow runs twice for PR'd in-repo branches #55

ZLLentz opened this issue Oct 7, 2024 · 2 comments

Comments

@ZLLentz
Copy link
Member

ZLLentz commented Oct 7, 2024

Current Behavior

If you make a branch in BEAMS, the github actions workflow will run.
If you make a PR in BEAMS, the github actions workflow will run.

If you make a PR of a branch in BEAMS, the github actions workflow will run twice and show up doubled in the PR.

This is because the (standard) github actions config we use has workflow triggers both on "push" and on "pull request".
If using only forks, the effect of the "push" workflow trigger is only ran on merges to master.
Here, since we're using local branches, we get to see double.

Expected Behavior

Workflows here should only run once each during a PR.
Learning from fixing this issue should be replaced in our templates/best practices.

Steps to Reproduce (for bugs)

  1. Make a new branch in pcdshub/BEAMS
  2. PR your branch into the default branch
  3. Peek at your "checks" section.

Suggested Solution

I'm not entirely sure where to start here

@tangkong
Copy link
Contributor

tangkong commented Oct 7, 2024

If we were forking properly, and as prescribed, this wouldn't be an issue. Realistically this is something we should fix in ci-helpers, I remember looking into this but not turning up a concise way to layer the triggers. I may be mistaken though

@tangkong
Copy link
Contributor

tangkong commented Oct 7, 2024

I lied, this is something to fix on the per-repo invocation. (workflow file). Maybe it really is as simple as something like:

  push:
    branches:
      - master
  pull_request:
    types: [ opened, synchronize, reopened ]
    branches:
      - master

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

No branches or pull requests

2 participants