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

Feature request: Skip only same ref #72

Closed
tschuchortdev opened this issue Dec 18, 2020 · 5 comments
Closed

Feature request: Skip only same ref #72

tschuchortdev opened this issue Dec 18, 2020 · 5 comments

Comments

@tschuchortdev
Copy link

Hi, I am using your GH action to try to prevent workflows with both push and pull_request trigger from running twice for a PR. The problem is that this also prevents the workflow from running again when the PR is eventually merged into master. Some jobs in the workflow (for example deployment) only run on the master branch and get cancelled even though they didn't run in the PR before. Would it be possible to add the option to only skip when the contents and ref are identical? I think this should be fairly easy to implement by adding another output variable same_ref so that users can combine this flag in an if expression however they like (I would do it myself but I don't know Typescript).

@fkirc
Copy link
Owner

fkirc commented Dec 18, 2020

Yes it should be very easy to implement, so the question is which options are both easy to understand and versatile enough.
Right now, I am thinking about the following options for a future update:

  • do_not_skip_branches: [optional list of branches]
  • skip_after_successful_duplicate: [default true]

Please let me know which of those makes sense, or perhaps we could do something more understandable with refs.

@fkirc
Copy link
Owner

fkirc commented Dec 18, 2020

Although I was not planning any new feature, I took quick action to implement your request with #73.
The main motivation why I am implementing your request is to make each and every feature optional.
The thing is that I saw numerous issues that wanted to selectively disable this or that feature.
So from now on, skip-duplicate-actions does not have any non-optional features anymore.

Therefore, if you set skip_after_successful_duplicate: 'false', then I hope that this will be enough to solve your use case.
Please let me know if there is still something non-optional or broken.

@fkirc fkirc closed this as completed Dec 18, 2020
@fkirc
Copy link
Owner

fkirc commented Dec 18, 2020

My initial implementation of skip_after_successful_duplicate was partially broken, so I did a quick fix with #74.

@tschuchortdev
Copy link
Author

Wow, that was quick. Thanks for implementing this, it seems to solve my use case. I think it might still be a good idea for you to expose internal variables like this as additional output variables. This will allow users to implement more complicated use cases independently and decrease the maintenance burden on your part.

@fkirc
Copy link
Owner

fkirc commented Dec 18, 2020

Thanks for your suggestions, I agree that additional output variables can be a good idea to increase flexibility and reduce maintenance burden.
In your case, you might be able to implement simple if-conditions in YAML to check if you are running on the master branch or another branch.
Nevertheless, it might be a good idea to expose something like "duplicate_workflow_ref".

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