-
Notifications
You must be signed in to change notification settings - Fork 130
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
Turn off CI for forks #264
Conversation
Pull Request Test Coverage Report for Build 4929848047
💛 - Coveralls |
I was wondering whether we could use an env var here so this can be set in one place even if the tests need to be in multiple places ie have the check can refer to the env var. I know in the past we have tested things out on local forks - though I have actions disabled at present so things don't run. But if I wanted to run this it would mean I only needed to change one place instead of multiples. |
Hm, like put the skip in the test code itself? I wish that GitHub had a way for us to add an
What was the motivation for this? |
Like setup an env var that is
and do in the tests
Not sure about quotes or not for string
In developing/changing workflows to test/debug them on a local fork before updating the main repo |
That is, the suggestion solves one problem but introduces another. Unless it is frequent that people need to re-enable CI checks on their fork rather than using upstream, I encourage going with the simpler solution of |
It was more for us - already some 3rd party will need to figure things and look into the workflow and understand it to find out why its not running if that was what they expected. I would rather change it in one place if I want to run/modify it on my fork than in multiple places. I think if they can do that they can figure what this is and the env var that affects it if: github.repository_owner == $REPO_OWNER After all the main concern was around wasting resources on peoples forks, not whether or not they can understand the workflow and if we are making things more complex in that regard, |
You're right; our primary goal is to minimize resource wastage. However, we also need to consider the code's maintainability and ease of understanding. There are only four references in a single file: a simple solution is to use "Find all and replace". Sometimes adhering strictly to DRY (Don't Repeat Yourself) is not the best approach, and following the WET (Write Everything Twice) principle is more appropriate: https://betterprogramming.pub/when-dry-doesnt-work-go-wet-6befda0444bf. In this particular case, I suggest that we prioritize simplicity and maintainability over introducing additional complexity, which makes the code harder to understand. |
For me things would be easier all round with single constant rather than having to know I need to do search and replace. And for me its easier to maintain - I would not rate code very highly that replicated the same constant everywhere. Having said that its easy enough to change going forwards I guess and rather than spend more effort discussing I can go ahead with this though I do not consider it ideal. |
(cherry picked from commit 1985aee)
Summary
Most people agree that GitHub made a mistake by having forks run CI both on the fork and in the upstream repository. It wastes computing resources (which has a real environmental cost!).
Details and comments
If people really want to run CI in their fork, they can always modify their fork's config to revert this change.