-
Notifications
You must be signed in to change notification settings - Fork 649
chore: port policy YAML from previous default branch #17555
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
Open
reubeno
wants to merge
1
commit into
microsoft:4.0
Choose a base branch
from
reubeno:policy-yaml
base: 4.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+163
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,163 @@ | ||
| # ============================================================================= | ||
| # Resource Management policy (GitHub "Policy Service" / GitOps). | ||
| # | ||
| # This file is consumed by Microsoft's GitOps Policy Service, NOT by GitHub | ||
| # Actions. The service watches the repo and reconciles behavior against the | ||
| # rules below. | ||
| # | ||
| # IMPORTANT SCOPING FACTS: | ||
| # * The service reads .github/policies/* ONLY from the repository's DEFAULT | ||
| # branch (currently `4.0`) and then applies the rules to PRs/issues | ||
| # targeting ANY branch. You therefore cannot keep "3.0 rules" on the 3.0 | ||
| # branch and "4.0 rules" on 4.0 -- everything lives here, on the default | ||
| # branch, and is discriminated by CONDITIONS (e.g. `targetsBranch`). | ||
| # * There is NO file- or group-level branch scope. Filenames are purely | ||
| # organizational. To scope a SET of rules to a branch, put a single | ||
| # `targetsBranch` guard in a parent task's top-level `if:` and nest the | ||
| # rules under its `then:` -- the top-level `if:` is ANDed, so every nested | ||
| # child inherits the guard (see the classic 3.0 group below). | ||
| # * The repo layout differs by era and uses DISJOINT top-level paths, so the | ||
| # area-label groups never collide: | ||
| # - classic (3.0/3.0-dev): SPECS*/, toolkit/ | ||
| # - azldev (4.0): base/, specs/, distro/, locks/, external/, ... | ||
| # | ||
| # Within a task, `if:` is a list of ANDed conditions and `then:` is a list of | ||
| # actions; both can be nested arbitrarily. | ||
| # ============================================================================= | ||
|
|
||
| # Top-level scalars below are part of the primitive's template and intentionally | ||
| # left empty. `id` is managed by the Policy Service; `owner`/`where`/`onFailure`/ | ||
| # `onSuccess` are optional and unused. (`where:` selects which REPOS an | ||
| # org-distributed policy targets -- it is NOT a branch/PR filter.) | ||
| id: | ||
| name: GitOps.PullRequestIssueManagement | ||
| description: GitOps.PullRequestIssueManagement primitive | ||
| owner: | ||
| resource: repository | ||
| disabled: false | ||
| where: | ||
| onFailure: | ||
| onSuccess: | ||
| configuration: | ||
| resourceManagementConfiguration: | ||
| scheduledSearches: [] | ||
| eventResponderTasks: | ||
| # ======================================================================= | ||
| # GROUP: 4.0+ area labels (GATED to the 4.0 branch). | ||
| # The single `or(targetsBranch ...)` guard scopes the ENTIRE group; every | ||
| # nested `if/then` inherits it. | ||
| # ======================================================================= | ||
| - description: Area labels for PRs that target 4.0 | ||
| if: | ||
| - payloadType: Pull_Request | ||
| - or: | ||
| - targetsBranch: | ||
| branch: "4.0" | ||
| then: | ||
| # Component definitions, rendered specs, and lock files -> Packaging. | ||
| - if: | ||
| - filesMatchPattern: | ||
| pattern: "^(base/comps|specs|locks)/" | ||
| matchAny: true # true = label if ANY changed file matches | ||
| then: | ||
| - addLabel: | ||
| label: Packaging | ||
| # Documentation | ||
| - if: | ||
| - filesMatchPattern: | ||
| pattern: "^docs/" | ||
| matchAny: true | ||
| then: | ||
| - addLabel: | ||
| label: documentation | ||
| # Branch-name label. The group is already gated to 4.0, so every PR | ||
| # reaching here targets 4.0 -- no nested condition needed. | ||
| - addLabel: | ||
| label: "4.0" | ||
|
|
||
| # ======================================================================= | ||
| # GROUP: 3.0-era area labels (GATED to the 3.0 branches). | ||
| # The single `or(targetsBranch ...)` guard in this parent `if:` scopes the | ||
| # ENTIRE group; every nested `if/then` below inherits it. To stop labeling | ||
| # a retired branch, just remove its line from the `or:` list. | ||
| # ======================================================================= | ||
| - description: Area labels for the classic (SPECS/toolkit) layout, 3.0 only | ||
| if: | ||
| - payloadType: Pull_Request | ||
| - or: | ||
|
reubeno marked this conversation as resolved.
|
||
| - targetsBranch: | ||
| branch: "3.0" | ||
| - targetsBranch: | ||
| branch: "3.0-dev" | ||
| - targetsBranch: | ||
| branch: "fasttrack/3.0" | ||
| then: | ||
| - if: | ||
| - filesMatchPattern: | ||
| pattern: "^(SPECS|SPECS-EXTENDED|SPECS-SIGNED)/" | ||
| matchAny: true | ||
| then: | ||
| - addLabel: | ||
| label: Packaging | ||
| - if: | ||
| - filesMatchPattern: | ||
| pattern: "^SPECS-EXTENDED/" | ||
| matchAny: true | ||
| then: | ||
| - addLabel: | ||
| label: specs-extended | ||
| - if: | ||
| - filesMatchPattern: | ||
| pattern: "^toolkit/docs/" | ||
| matchAny: true | ||
| then: | ||
| - addLabel: | ||
| label: documentation | ||
| - if: | ||
| - filesMatchPattern: | ||
| pattern: "^toolkit/(tools|scripts)/" | ||
| matchAny: true | ||
| then: | ||
| - addLabel: | ||
| label: Tools | ||
| - if: | ||
| - filesMatchPattern: | ||
| pattern: "^toolkit/(imageconfigs|tools/imagegen/configuration)/" | ||
| matchAny: true | ||
| then: | ||
| - addLabel: | ||
| label: Schema | ||
|
|
||
| # Branch-name labels. We always add the '3.0' label for any PR targeting a | ||
| # 3.0 branch, and *also* add a "fasttrack/3.0" label for PRs targeting the | ||
| # fasttrack branch. | ||
| - addLabel: | ||
| label: "3.0" | ||
| - if: | ||
| - targetsBranch: | ||
| branch: "fasttrack/3.0" | ||
| then: | ||
| - addLabel: | ||
| label: "fasttrack/3.0" | ||
|
|
||
| # ======================================================================= | ||
| # Era-independent: label PRs opened by an automation bot account. | ||
| # `issueAuthor: false` -> match when the BOT is the activity sender. | ||
| # The `or:` block matches when EITHER known automation account opened the | ||
| # PR; add more accounts here as they appear. | ||
| # ======================================================================= | ||
| - description: Label automated PRs opened by a bot account | ||
| if: | ||
| - payloadType: Pull_Request | ||
| - isAction: | ||
| action: Opened | ||
| - or: | ||
| - isActivitySender: | ||
| user: CBL-Mariner-Bot | ||
| issueAuthor: false | ||
| - isActivitySender: | ||
| user: azurelinux-security | ||
| issueAuthor: false | ||
| then: | ||
| - addLabel: | ||
| label: Automatic PR | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.