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 actions when pushing in this repository #15

Merged
merged 1 commit into from
Jul 9, 2023

Conversation

diazona
Copy link
Owner

@diazona diazona commented Jul 8, 2023

Currently when creating a pull request (at least, one not in a fork, but at the moment there are no forks anyway), we get two copies of each Github action, one for the branch push and one for the pull request. The change in this commit should skip the action running for the pull request whenever the source branch exists locally in this repository. It shouldn't affect branches coming from other people's forks, if there are forks in the future.

I copied the logic to do this from another project in which I worked out how to do the same thing. The comment I've added to the workflow refers to a blog post I relied on when figuring out how to make this work for that other project.

@diazona diazona added this to the Initial release milestone Jul 8, 2023
@diazona diazona requested a review from sjlongland July 8, 2023 07:48
@diazona diazona assigned sjlongland and diazona and unassigned sjlongland Jul 8, 2023
@diazona
Copy link
Owner Author

diazona commented Jul 8, 2023

Actually let's wait on this one - I want to be sure it actually works and that might involve retriggering some CI checks.

@diazona diazona removed the request for review from sjlongland July 8, 2023 07:49
@diazona diazona marked this pull request as draft July 8, 2023 07:49
@diazona diazona force-pushed the avoid-duplicate-actions/1/dev branch from 76da175 to 7b7c309 Compare July 9, 2023 01:01
Currently when creating a pull request (at least, one not in a fork, but
at the moment there are no forks anyway), we get two copies of each
Github action, one for the branch push and one for the pull request.
The change in this commit should skip the action running for the pull
request whenever the source branch exists locally in this repository.
It shouldn't affect branches coming from other people's forks, if there
are forks in the future.

I copied the logic to do this from another project in which I worked out
how to do the same thing:
  pytest-dev/pytest-localserver#45
The comment I've added to the workflow refers to a blog post I relied on
when figuring out how to make this work for that other project.
@diazona diazona force-pushed the avoid-duplicate-actions/1/dev branch from 7b7c309 to 2898f57 Compare July 9, 2023 01:09
@diazona diazona marked this pull request as ready for review July 9, 2023 21:01
@diazona diazona requested a review from sjlongland July 9, 2023 21:03
@diazona
Copy link
Owner Author

diazona commented Jul 9, 2023

I think it's ready to go now...

@diazona diazona assigned sjlongland and unassigned diazona Jul 9, 2023
@sjlongland sjlongland merged commit 813c73b into main Jul 9, 2023
@sjlongland sjlongland deleted the avoid-duplicate-actions/1/dev branch July 9, 2023 21:54
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

Successfully merging this pull request may close these issues.

2 participants