diff --git a/.github/policies/auto-merge.yml b/.github/policies/auto-merge.yml new file mode 100644 index 0000000..4b93405 --- /dev/null +++ b/.github/policies/auto-merge.yml @@ -0,0 +1,47 @@ +id: +name: GitOps.PullRequestIssueManagement +description: GitOps.PullRequestIssueManagement primitive +owner: +resource: repository +disabled: false +where: +configuration: + resourceManagementConfiguration: + eventResponderTasks: + - description: Approve and auto-squash-merge bot PRs to main labeled 'auto-merge' + triggerOnOwnActions: true + if: + - payloadType: Pull_Request + - labelAdded: + label: ':octocat: auto-merge' + - targetsBranch: + branch: main + - isActivitySender: + user: microsoft-github-policy-service[bot] + then: + - enableAutoMerge: + mergeMethod: Squash + - approvePullRequest: + comment: "Approved; this PR will merge when all status checks pass." + + - description: Auto-merge policy service bot PRs to live labeled 'auto-merge' + triggerOnOwnActions: true + if: + - payloadType: Pull_Request + - labelAdded: + label: ':octocat: auto-merge' + - targetsBranch: + branch: live + - isActivitySender: + user: microsoft-github-policy-service[bot] + then: + - enableAutoMerge: + mergeMethod: Merge + + - description: Don't auto-merge PRs with 'auto-merge' label removed + if: + - payloadType: Pull_Request + - labelRemoved: + label: ':octocat: auto-merge' + then: + - disableAutoMerge \ No newline at end of file diff --git a/.github/policies/scheduled-prod-sync.yml b/.github/policies/scheduled-prod-sync.yml index 3e3022c..58015d5 100644 --- a/.github/policies/scheduled-prod-sync.yml +++ b/.github/policies/scheduled-prod-sync.yml @@ -16,7 +16,8 @@ configuration: head: main base: live title: Merge main into live - body: Automated merge of the main branch into live, syncing documentation content to the production environment. + body: Automated merge of the main branch into live. + - description: Push to live branch (scheduled 7PM PT publish) frequencies: - daily: @@ -27,7 +28,8 @@ configuration: head: main base: live title: Merge main into live - body: Automated merge of the main branch into live, syncing documentation content to the production environment. + body: Automated merge of the main branch into live. + - description: Push to live branch (scheduled 3AM PT publish) frequencies: - daily: @@ -38,4 +40,4 @@ configuration: head: main base: live title: Merge main into live - body: Automated merge of the main branch into live, syncing documentation content to the production environment. + body: Automated merge of the main branch into live. diff --git a/.github/policies/scheduled-stage-sync.yml b/.github/policies/scheduled-stage-sync.yml index 70c1c6d..0ab4a18 100644 --- a/.github/policies/scheduled-stage-sync.yml +++ b/.github/policies/scheduled-stage-sync.yml @@ -16,7 +16,8 @@ configuration: head: smoke-test base: main title: Merge smoke-test into main - body: Automated merge of the smoke-test branch into main, syncing API documentation content to the staging environment. + body: Automated merge of the smoke-test branch into main. + - description: Push to main branch (scheduled 6PM PT publish) frequencies: - daily: @@ -27,7 +28,8 @@ configuration: head: smoke-test base: main title: Merge smoke-test into main - body: Automated merge of the smoke-test branch into main, syncing API documentation content to the staging environment. + body: Automated merge of the smoke-test branch into main. + - description: Push to main branch (scheduled 2AM PT publish) frequencies: - daily: @@ -38,4 +40,4 @@ configuration: head: smoke-test base: main title: Merge smoke-test into main - body: Automated merge of the smoke-test branch into main, syncing API documentation content to the staging environment. + body: Automated merge of the smoke-test branch into main. diff --git a/.github/policies/handle-automatic-pr.yml b/.github/policies/tag-automatic-pr.yml similarity index 69% rename from .github/policies/handle-automatic-pr.yml rename to .github/policies/tag-automatic-pr.yml index d56b3b9..d1be251 100644 --- a/.github/policies/handle-automatic-pr.yml +++ b/.github/policies/tag-automatic-pr.yml @@ -8,7 +8,7 @@ where: configuration: resourceManagementConfiguration: eventResponderTasks: - - description: Sync API documentation to staging environment. + - description: Sync API docs to staging triggerOnOwnActions: true if: - payloadType: Pull_Request @@ -22,11 +22,8 @@ configuration: then: - addLabel: label: ':octocat: auto-merge' - - enableAutoMerge: - mergeMethod: Squash - - approvePullRequest: - comment: ':shipit:' - - description: Sync staging environment to production. + + - description: Sync staging to production triggerOnOwnActions: true if: - payloadType: Pull_Request @@ -39,8 +36,4 @@ configuration: isRegex: False then: - addLabel: - label: ':octocat: auto-merge' - - enableAutoMerge: - mergeMethod: Merge - - approvePullRequest: - comment: ':shipit:' \ No newline at end of file + label: ':octocat: auto-merge' \ No newline at end of file