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

Skip duplicate action runs #2929

Closed
nateberkopec opened this issue Sep 8, 2022 · 7 comments · Fixed by #3008
Closed

Skip duplicate action runs #2929

nateberkopec opened this issue Sep 8, 2022 · 7 comments · Fixed by #3008

Comments

@nateberkopec
Copy link
Member

New PRs run actions twice, once for PR and once for push trigger. Let's fix that, either via https://github.com/marketplace/actions/skip-duplicate-actions#skip-duplicate-workflow-runs or something else.

@dentarg
Copy link
Member

dentarg commented Sep 8, 2022

New PRs run actions twice, once for PR and once for push trigger.

I haven't double checked this but I think this is only the case when the PR doesn't come from a fork (although it my run the tests in their fork too)

@MSP-Greg
Copy link
Member

MSP-Greg commented Sep 8, 2022

Actions allows filtering by branch for 'events'. Two standard events are 'push' and 'pull_request'.

If we filter branches in Actions, it affects both CI in this repo and forks.

Maybe an option is to filter branches on pushes here when the branch matches 'pr/**' or 'pr-*'?

Or, to create a branch here (puma/puma) for a PR, it must start with the above?

I've often run into this where a repo only allows 'push' events to run on active release branches. One creates a branch in their fork for a PR, and when it's pushed to the fork, CI doesn't run.

Then one has to screw around with rebasing master/main on the PR branch, running CI, then removing the commit(s) from master/main, etc.

@dentarg
Copy link
Member

dentarg commented Sep 8, 2022

I agree, it should continue to be easy to work in a fork

@nateberkopec
Copy link
Member Author

Summarizing for the benefit of those who want to contribute, the feature is:

Using https://github.com/marketplace/actions/skip-duplicate-actions#skip-duplicate-workflow-runs:

  1. Skip duplicate actions
  2. Skip concurrent actions
  3. Skip documentation-only changes using ignored paths
  4. Skip ragel tests if extension directory is not changed
  5. Cancel outdated workflow runs

Contributors can implement one or all of these features.

@MSP-Greg
Copy link
Member

JFYI, I've brought this issue up in the actions/runner repo, it was suggested that I post elsewhere, see:
https://github.com/orgs/community/discussions/32809

@MemunaHaruna
Copy link
Contributor

Summarizing for the benefit of those who want to contribute, the feature is:

Using https://github.com/marketplace/actions/skip-duplicate-actions#skip-duplicate-workflow-runs:

  1. Skip duplicate actions
  2. Skip concurrent actions
  3. Skip documentation-only changes using ignored paths
  4. Skip ragel tests if extension directory is not changed
  5. Cancel outdated workflow runs

Contributors can implement one or all of these features.

hi @nateberkopec if this is still needed, I'd like to work on it.

@nateberkopec
Copy link
Member Author

Hi @MemunaHaruna, as we mention in CONTRIBUTING.md, if there's no PR open, it's ready for anyone to contribute! 😄

MemunaHaruna added a commit to MemunaHaruna/puma that referenced this issue Oct 30, 2022
MemunaHaruna added a commit to MemunaHaruna/puma that referenced this issue Oct 30, 2022
MemunaHaruna added a commit to MemunaHaruna/puma that referenced this issue Oct 30, 2022
nateberkopec pushed a commit that referenced this issue Nov 2, 2022
* Skip duplicate Github Actions runs (#2929)

Closes #2929

Skip conditions have been added at the step level for matrix jobs because of:
https://github.com/marketplace/actions/skip-duplicate-actions#how-to-use-skip-check-with-required-matrix-jobs

* Update the skip_duplicate_workflow_runs workflow

Remove the `cancel_others` setting since cancelling workflow runs from outdated commits requires the `actions: write` permission.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants