-
Notifications
You must be signed in to change notification settings - Fork 97
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 deploy workflows in forked repos #347
Skip deploy workflows in forked repos #347
Conversation
Signed-off-by: Yasumasa Suenaga <[email protected]>
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## dev #347 +/- ##
=======================================
Coverage 74.21% 74.21%
=======================================
Files 77 77
Lines 2637 2637
Branches 266 266
=======================================
Hits 1957 1957
Misses 598 598
Partials 82 82 |
Thank you @YaSuenag. If I understand correctly, this would make these workflows only work for the original repo (this one, the carbon aware SDK), and be disabled in forks. What I would suggest are the following 2 things:
Could this PR cover those? I believe that these workflows would then help achieve testing required for workflows in forks, or simply provide a starting point for clones/forks on this repo that need all that plumbing to get started with DevOps? cc @vaughanknight for visibility |
We can use
I completely agree with you because I thought so when I checked dev_carbon-aware-api.yml , however I think it is a different issue from this, and also I'm not familiar with Azure Web Apps. |
I guess we can use |
I discussed about this PR with @danuw in weekly meeting, then I understand that it make sence to run the workflow by the (configuration) value. It would be reasonable for developer to evaluate entire of workflows, or debug workflows which should be disabled on forked repo. I think it is reasonable to use |
@danuw mentioned using gh repo variables as triggers for enabling/disabling this workflows (workflows will check for the presence of them). Variables will need to be set up by devs so there won't be any errors by default |
Signed-off-by: Yasumasa Suenaga <[email protected]>
I introduced two variables for this PR:
You can set them on repository with following https://docs.github.com/en/actions/learn-github-actions/variables#creating-configuration-variables-for-a-repository In GSF organization repo (Green-Software-Foundation/carbon-aware-sdk), they will be run regardless of them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - #363 we had a discussion whether adding a comment in the workflow is necessary for developers to know how to enable them if necessary, IMO the if statement is self explanatory but happy to hear more thoughts
* Skip deploy workflows in forked repos Signed-off-by: Yasumasa Suenaga <[email protected]> * Add vars Signed-off-by: Yasumasa Suenaga <[email protected]> --------- Signed-off-by: Yasumasa Suenaga <[email protected]>
Pull Request
Summary
CASDK repo has two workflows for deployment.
They expect to run on original repo ( Green-Software-Foundation/carbon-aware-sdk ), however it would run on forked repo because they would also be triggered by pushing to
dev
branch. Thus we will see some errors on GHA as following.It is noisy to work on forked repo, thus we need to skip them in forked repositories.
After this change, they are skipped as following:
Changes
Checklist
Are there API Changes?
No
Is this a breaking change?
No
Anything else?
I checked this change on my forked repo, but we need to pay attention to their behavior when some changes are pushed into
dev
on GSF CASDK repo. It is ok if they work without any errors.