-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add repo-specific condition to labeling workflows #112169
Conversation
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
Are you going to put this into arcade, and if so will other repos extend this if? Is there some way to pass the setting externally to achieve the same thing but without making this less reusable? Nit only |
@@ -12,6 +12,7 @@ on: | |||
|
|||
jobs: | |||
check-labels: | |||
if: github.repository == 'dotnet/runtime' |
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.
To @danmoseley's question:
Are you going to put this into arcade, and if so will other repos extend this if? Is there some way to pass the setting externally to achieve the same thing but without making this less reusable? Nit only
I spent some time searching across GitHub docs and code searches, a grep.app search, and asking Copilot for best practices around this, and hard-coding either the repository name or just the repository owner name are indeed the state of the art here. Theoretically, we could set up an environment variable that would be available to all our workflow runners, and we could check that environment variable, but since I don't see anyone else doing that I think the consensus is that making this more dynamic isn't worth the effort.
For any workflow that is going to be shared across repos (or at least referenced as something that could be copied into other repos), we'd want to just check the repository_owner like we do in locker.yml. For these workflows, either approach should be fine.
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.
checking for the repository_owner is what we do in the backport workflow: https://github.com/dotnet/arcade/blob/ccd609b1f2b18c2899d332f88fe37f13bc3f16cb/.github/workflows/backport-base.yml#L17-L21
Co-authored-by: Jeff Handley <[email protected]>
@jeffhandley I applied your suggestions, thanks. If there's anything else to address, I can happily do it post-merge. I am seeing a bunch of "Approve workflow" buttons in servicing, so I would like to merge this PR to confirm that merging only for main will take care of servicing too. |
Looks good, @carlossanlop; thanks. For pull requests into the servicing branches, if those pull requests contain workflows that use |
@jeffhandley, right, but that sounds like we still need to backport the change to release/X.0 and release/X.0-staging branches, to ensure that when they act as the target branch for a servicing PR, the pull_request_target is used. Am I correct? |
* main: (23 commits) add important remarks to NrbfDecoder (dotnet#111286) docs: fix spelling grammar and missing words in clr-code-guide.md (dotnet#112222) Consider type declaration order in MethodImpls (dotnet#111998) Add a feature flag to not use GVM in Linq Select (dotnet#109978) [cDAC] Implement ISOSDacInterface::GetMethodDescPtrFromIp (dotnet#110755) Restructure JSImport/JSExport generators to share more code and utilize more Microsoft.Interop.SourceGeneration shared code (dotnet#107769) Add more detailed explanations to control-flow RegexOpcode values (dotnet#112170) Add repo-specific condition to labeling workflows (dotnet#112169) Fix bad assembly when a nested exported type is marked via link.xml (dotnet#107945) Make `CalculateAssemblyAction` virtual. (dotnet#112154) JIT: Enable reusing profile-aware DFS trees between phases (dotnet#112198) Add support for LDAPTLS_CACERTDIR \ TrustedCertificateDirectory (dotnet#111877) JIT: Support custom `ClassLayout` instances with GC pointers in them (dotnet#112064) Factor positive lookaheads better into find optimizations (dotnet#112107) Add ImmutableCollectionsMarshal.AsMemory (dotnet#112177) [mono] ILStrip write directly to the output filestream (dotnet#112142) Allow the NativeAOT runtime pack to be specified as the ILC runtime package (dotnet#111876) JIT: some reworking for conditional escape analysis (dotnet#112194) Replace HELPER_METHOD_FRAME with DynamicHelperFrame in patchpoints (dotnet#112025) [Android] Decouple runtime initialization and entry point execution for Android sample (dotnet#111742) ...
Oh gosh; you're right, @carlossanlop. It wasn't clicking for me that the release branches are the "target" here. Thanks for clarifying. |
* Condition labeling workflows to only run on dotnet/runtime. * Improve readme * Add jeffhandley as explicit workflow owner Co-authored-by: Jeff Handley <[email protected]>
* Condition labeling workflows to only run on dotnet/runtime. * Improve readme * Add jeffhandley as explicit workflow owner Co-authored-by: Jeff Handley <[email protected]>
Follow-up of #112161
Condition the labeling workflows so they only work in dotnet/runtime. Also improve readme as suggested, and also add @jeffhandley as explicit codeowner for workflows.