Skip to content

Commit d43cc22

Browse files
authored
Merge branch 'main' into M365-Endpoints
2 parents 52f9c32 + 335a7c1 commit d43cc22

File tree

368 files changed

+1173
-589
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

368 files changed

+1173
-589
lines changed

.github/workflows/M365Endpoints.yml

Lines changed: 203 additions & 74 deletions
Large diffs are not rendered by default.
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
name: (Scheduled) Stale branch removal
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
# Commenting out schedule in MAX-CPUB-Test because it's actually running and impacting the production repo. If the workflow needs to be updated here
8+
# and put into production, remove this comment and uncomment the schedule.
9+
#schedule:
10+
#- cron: "0 */6 * * *"
11+
12+
workflow_dispatch:
13+
14+
15+
jobs:
16+
17+
stale-branch:
18+
name: Removal stale branches
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Process branches
22+
shell: pwsh
23+
env:
24+
SkipBranchList: '[
25+
"live",
26+
"main",
27+
"repo_sync_working_branch",
28+
"asdf"
29+
]'
30+
PayloadJson: ${{ toJSON(github) }}
31+
AccessToken: ${{ secrets.GITHUB_TOKEN }}
32+
run: |
33+
34+
# Get GitHub data
35+
$GitHubData = $env:PayloadJson | ConvertFrom-Json -Depth 50
36+
$AccessToken = $env:AccessToken
37+
$SkipBranchList = $env:SkipBranchList | ConvertFrom-Json
38+
39+
40+
# WARNING - Setting $MaxAheadDefault to anything other than 0 means that the workflow will delete branches with changes not in default branch.
41+
# !!! > 0 WILL RESULT IN DATA LOSS !!!
42+
$MaxAheadDefault = 0 # This is the maximum number of commits a branch can be ahead of default branch.
43+
$AllowDataLoss = $False # This flag must be set to $True to allow branches with commits not in default branch to be deleted.
44+
# !!! > 0 WILL RESULT IN DATA LOSS !!!
45+
46+
$MaxDaysBehind = 90
47+
$DateLimit = (Get-Date).AddDays(-$MaxDaysBehind)
48+
49+
# Create github HTTP authentication header
50+
$UserAgent = "officedocs"
51+
$GitHubHeaders = @{}
52+
$GitHubHeaders.Add("Authorization","token $($AccessToken)")
53+
$GitHubHeaders.Add("User-Agent", $UserAgent)
54+
55+
$RepoUrl = $GitHubData.event.repository.url
56+
$RepoData = Invoke-RestMethod -Headers $GitHubHeaders -Uri $RepoUrl -Method GET
57+
58+
$BranchesUrl = $RepoData.branches_url.Replace("{/branch}", "")
59+
60+
$DefaultBranch = $RepoData.default_branch
61+
$SyncBranch = "repo-sync-working-branch"
62+
$CompareUrl = $RepoData.compare_url.Replace("{base}...{head}", "$DefaultBranch...")
63+
64+
$Branches = Invoke-RestMethod -Headers $GitHubHeaders -Uri $BranchesUrl -Method GET -FollowRelLink -MaximumFollowRelLink 50 -ResponseHeadersVariable ResponseHeaders
65+
66+
$ReportBranchList = @()
67+
68+
ForEach ($Page in $Branches) {
69+
70+
ForEach ($Branch in $Page) {
71+
72+
$AheadBy = $BehindBy = $LastCommitDate = $CompareData = $Null
73+
$ProtectedBranch = $True
74+
75+
$BranchName = $Branch.name
76+
$CommitsUrl = $RepoData.commits_url.Replace("{/sha}", "?sha=$BranchName&per_page=1&page=1")
77+
78+
Write-Host "`nBranch name: $BranchName"
79+
80+
If ($SkipBranchList -contains $BranchName) {
81+
Write-Host " Skipped. Branch is on the branch skip list."
82+
continue
83+
}
84+
85+
# $BranchData = Invoke-RestMethod -Headers $GitHubHeaders -Uri "$branchesurl/$BranchName" -Method GET -ResponseHeadersVariable ResponseHeaders
86+
# $ProtectedBranch = $BranchData.protected
87+
$ProtectedBranch = $Branch.protected
88+
89+
Write-Host " Protected: $ProtectedBranch."
90+
91+
If ($ProtectedBranch) {
92+
Write-Host " Skipped. Branch is protected."
93+
continue
94+
}
95+
96+
$LastCommitDate = (Invoke-RestMethod -Headers $GitHubHeaders -uri $CommitsUrl).commit.committer.date
97+
98+
Write-Host " Last commit date: $LastCommitDate."
99+
100+
If ($LastCommitDate -ge $DateLimit) {
101+
Write-Host " Skipped. Last commit date is after $DateLimit."
102+
continue
103+
}
104+
105+
$CompareData = Invoke-RestMethod -Headers $GitHubHeaders -Uri "$CompareUrl$BranchName" -Method GET -ResponseHeadersVariable ResponseHeaders
106+
107+
$BehindBy = $CompareData.behind_by
108+
$AheadBy = $CompareData.ahead_by
109+
110+
Write-Host " Ahead of $DefaultBranch by: $AheadBy `n Behind by: $BehindBy."
111+
112+
If ($AheadBy -gt $MaxAheadDefault) {
113+
Write-Host " Skipped. Branch exceeds `"ahead by`" limit of $MaxAheadDefault."
114+
115+
$ReportBranchList += ">>> Branch watch list <<< $BranchName exceeds maximum age but has outstanding commits that exceed maximum Ahead By limit. Branch protected: $ProtectedBranch. Ahead by: $AheadBy. Behind by $BehindBy. Days since last commit: $($($(Get-Date) - $LastCommitDate).Days)."
116+
117+
continue
118+
}
119+
120+
121+
If ($AheadBy -eq 0) {
122+
123+
Write-Host " Delete branch $BranchName"
124+
125+
$BranchDeleteUrl = $RepoData.url + "/git/refs/heads/$BranchName"
126+
Invoke-RestMethod -Headers $GitHubHeaders -Uri $BranchDeleteUrl -Method DELETE -ResponseHeadersVariable ResponseHeaders | Out-Null
127+
128+
$ReportBranchList += "$BranchName deleted. Branch protected: $ProtectedBranch. Ahead by: $AheadBy. Behind by $BehindBy. Days since last commit: $($($(Get-Date) - $LastCommitDate).Days). "
129+
130+
$DeleteBranchCount++
131+
132+
} Else {
133+
134+
If ($AllowDataLoss) {
135+
136+
Write-Host " Delete branch $BranchName with data loss"
137+
138+
$ReportBranchList += "!!! DATA LOSS !!! $BranchName deleted. Branch protected: $ProtectedBranch. Ahead by: $AheadBy. Behind by $BehindBy. Days since last commit: $($($(Get-Date) - $LastCommitDate).Days). "
139+
140+
$DeleteBranchCount++
141+
142+
} Else {
143+
144+
Write-Host " Branch $BranchName was marked for deletion with data loss but data loss flag is disabled."
145+
146+
$ReportBranchList += "*** DATA LOSS BLOCKED *** $BranchName was marked for deletion with data loss but the data loss flag is disabled. Branch protected: $ProtectedBranch. Ahead by: $AheadBy. Behind by $BehindBy. Days since last commit: $($($(Get-Date) - $LastCommitDate).Days)."
147+
148+
}
149+
150+
}
151+
152+
153+
154+
}
155+
156+
157+
}
158+
159+
Write-Host "`n`n`n"
160+
161+
$ReportBranchList = $ReportBranchList | Sort-Object
162+
163+
ForEach ($Item in $ReportBranchList) {
164+
165+
Write-Host $Item
166+
167+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
author: MandiOhlinger
3+
ms.author: mandia
4+
manager: laurawi
5+
ms.reviewer: cabailey
6+
ms.service: microsoft-365-copilot
7+
ms.topic: include
8+
description: Create default Microsoft Purview sensitivity labels for Microsoft 365 Copilot.
9+
ms.date: 03/06/2025
10+
---
11+
12+
1. Sign into the [Microsoft Purview portal](https://purview.microsoft.com/) as an admin in one of the groups listed at [Sensitivity labels - permissions](/purview/get-started-with-sensitivity-labels#permissions-required-to-create-and-manage-sensitivity-labels).
13+
14+
2. Select **Solutions** > **DSPM for AI** > **Overview**.
15+
3. In the **Recommendations** section, select **Information Protection Policy for Sensitivity Labels**. This step creates the default labels and their policies.
16+
4. To see or edit the default labels, or to create your own labels, select **Information protection** > **Sensitivity labels**. You might have to select **Refresh**.
17+
18+
When you have the default sensitivity labels:
19+
20+
- The labels help protect your data and can affect Copilot results.
21+
- Your users can start manually applying published labels to their files and emails.
22+
- Admins can start creating policies and configuring features that automatically apply labels to files and emails.
23+
24+
At any time, you can create your own sensitivity labels. To learn more, see [Create and configure sensitivity labels and their policies](/purview/create-sensitivity-labels).
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
author: MandiOhlinger
3+
ms.author: mandia
4+
manager: laurawi
5+
ms.reviewer: cabailey
6+
ms.service: microsoft-365-copilot
7+
ms.topic: include
8+
description: Enable and configure sensitivity labels for containers that affect Microsoft 365 Copilot.
9+
ms.date: 03/06/2025
10+
---
11+
12+
Instead, the label settings can restrict access to the container. This restriction provides an extra layer of security when you use Copilot. If a user can't access the site or workspace, Copilot can't access it on behalf of that user.
13+
14+
For example, you can set the privacy setting to **Private**, which restricts site access to only approved members in your organization. When the label is applied to the site, it replaces any previous setting and locks the site for as long as the label is applied. This feature is a more secure setting than letting anybody access the site and allowing users to change the setting. When only approved members can access the data, it helps prevent oversharing of data that Copilot might access.
15+
16+
To configure any label settings for groups and sites, you must enable this feature in your tenant and then synchronize your labels. This configuration is a one-time configuration and uses PowerShell. To learn more, see [How to enable sensitivity labels for containers and synchronize labels](/purview/sensitivity-labels-teams-groups-sites#how-to-enable-sensitivity-labels-for-containers-and-synchronize-labels).
17+
18+
You can then edit your sensitivity labels, or create new sensitivity labels specifically for groups and sites:
19+
20+
1. For the sensitivity label scope, select **Groups & sites**. Remember, you must have already run the PowerShell commands. If you didn't, you can't select this scope.
21+
22+
To learn more, see [How to enable sensitivity labels for containers and synchronize labels](/purview/sensitivity-labels-teams-groups-sites#how-to-enable-sensitivity-labels-for-containers-and-synchronize-labels).
23+
24+
2. Select the groupings of settings to configure. Some of the settings have backend dependencies before they can be enforced, like Conditional Access that must be already configured. The privacy setting, which is included in **Privacy and external user access settings**, doesn't have any backend dependencies.
25+
26+
3. Configure the settings you want to use and save your changes.
27+
28+
For more information, including details of all the available label settings that you can configure for groups and sites, see [Use sensitivity labels to protect content in Microsoft Teams, Microsoft 365 groups, and SharePoint sites](/purview/sensitivity-labels-teams-groups-sites).

copilot/microsoft-365-copilot-e3-guide.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ f1.keywords:
66
ms.author: mandia
77
author: MandiOhlinger
88
manager: laurawi
9-
ms.date: 01/15/2025
9+
ms.date: 03/06/2025
1010
ms.reviewer: cabailey, ruihu
1111
audience: Admin
1212
ms.topic: get-started
@@ -149,7 +149,13 @@ To learn more, see:
149149

150150
- [Create and configure sensitivity labels and their policies](/purview/create-sensitivity-labels)
151151

152-
#### 2. Publish your labels and educate your users
152+
#### 2. Enable and configure sensitivity labels for containers
153+
154+
You can apply sensitivity labels to containers, like Microsoft Teams or SharePoint sites, and Microsoft Loop workspaces. Items in a container don't inherit the sensitivity label.
155+
156+
[!INCLUDE [copilot-e5-e3-enable-sensitivity-labels-containers](./includes/copilot-e5-e3-enable-sensitivity-labels-containers.md)]
157+
158+
#### 3. Publish your labels and educate your users
153159

154160
1. Add your labels to a publishing policy. When they're published, users can manually apply the labels in their Office apps. The publishing policies also have settings that you need to consider, like a default label and requiring users to label their data.
155161

@@ -163,11 +169,11 @@ To learn more, see:
163169

164170
3. Monitor your labels. Select **Information protection** > **Reports**. You can see the usage of your labels.
165171

166-
#### 3. Enable sensitivity labels for files in SharePoint and OneDrive
172+
#### 4. Enable sensitivity labels for files in SharePoint and OneDrive
167173

168174
[!INCLUDE [copilot-e5-e3-enable-sensitivity-labels-sharepoint-onedrive](./includes/copilot-e5-e3-enable-sensitivity-labels-sharepoint-onedrive.md)]
169175

170-
#### 4. Apply a sensitivity label to your SharePoint document libraries
176+
#### 5. Apply a sensitivity label to your SharePoint document libraries
171177

172178
You can use a sensitivity label on your SharePoint document libraries, and make this label the default label that applies to all document libraries. This configuration is appropriate when your document libraries store files with the same level of sensitivity.
173179

copilot/microsoft-365-copilot-e5-guide.md

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ f1.keywords:
66
ms.author: mandia
77
author: MandiOhlinger
88
manager: laurawi
9-
ms.date: 01/15/2025
9+
ms.date: 03/06/2025
1010
ms.reviewer: cabailey, ruihu
1111
audience: Admin
1212
ms.topic: get-started
@@ -163,37 +163,13 @@ To learn more about sensitivity labels, see:
163163

164164
#### 1. Create the default sensitivity labels
165165

166-
1. Sign into the [Microsoft Purview portal](https://purview.microsoft.com/) as an admin in one of the groups listed at [Sensitivity labels - permissions](/purview/get-started-with-sensitivity-labels#permissions-required-to-create-and-manage-sensitivity-labels).
167-
168-
2. Select **Solutions** > **DSPM for AI** > **Overview**.
169-
3. In the **Recommendations** section, select **Information Protection Policy for Sensitivity Labels**. This step creates the default labels and their policies.
170-
4. To see or edit the default labels, or to create your own labels, select **Information protection** > **Sensitivity labels**. You might have to select **Refresh**.
171-
172-
When you have the default sensitivity labels:
173-
174-
- The labels help protect your data and can affect Copilot results.
175-
- Your users can start manually applying published labels to their files and emails.
176-
- Admins can start creating policies and configuring features that automatically apply labels to files and emails.
166+
[!INCLUDE [copilot-e5-e3-create-default-sensitivity-labels](./includes/copilot-e5-e3-create-default-sensitivity-labels.md)]
177167

178168
#### 2. Enable and configure sensitivity labels for containers
179169

180-
The default sensitivity labels don't include settings for groups and sites, which let you apply a sensitivity label to a SharePoint or Teams site, or Microsoft Loop workspace. Items in the container don't inherit the sensitivity label. Instead, the label settings can restrict access to the container. This restriction provides an extra layer of security when you use Copilot. If a user can't access the site or workspace, Copilot can't access it on behalf of that user.
181-
182-
For example, you can set the privacy setting to **Private**, which restricts site access to only approved members in your organization. When the label is applied to the site, it replaces any previous setting and locks the site for as long as the label is applied. This feature is a more secure setting than letting anybody access the site and allowing users to change the setting. When only approved members can access the data, it helps prevent oversharing of data that Copilot might access.
183-
184-
To configure any label settings for groups and sites, you must enable this capability for your tenant and then synchronize your labels. This configuration is a one-time configuration. To learn more, see [How to enable sensitivity labels for containers and synchronize labels](/purview/sensitivity-labels-teams-groups-sites#how-to-enable-sensitivity-labels-for-containers-and-synchronize-labels).
185-
186-
You can then edit your sensitivity labels, or create new sensitivity labels specifically for groups and sites:
187-
188-
1. For the sensitivity label scope, select **Groups & sites**. Remember, you must have already run the PowerShell commands. If you didn't, you can't select this scope.
189-
190-
To learn more, see [How to enable sensitivity labels for containers and synchronize labels](/purview/sensitivity-labels-teams-groups-sites#how-to-enable-sensitivity-labels-for-containers-and-synchronize-labels).
191-
192-
2. Select the groupings of settings to configure. Some of the settings have backend dependencies before they can be enforced, like Conditional Access that must be already configured. The privacy setting, which is included in **Privacy and external user access settings**, doesn't have any backend dependencies.
193-
194-
3. Configure the settings you want to use and save your changes.
170+
The default sensitivity labels don't include settings for groups and sites, which let you apply a sensitivity label to a SharePoint or Teams site, or Microsoft Loop workspace. Items in a container don't inherit the sensitivity label.
195171

196-
For more information, including details of all the available label settings that you can configure for groups and sites, see [Use sensitivity labels to protect content in Microsoft Teams, Microsoft 365 groups, and SharePoint sites](/purview/sensitivity-labels-teams-groups-sites).
172+
[!INCLUDE [copilot-e5-e3-enable-sensitivity-labels-containers](./includes/copilot-e5-e3-enable-sensitivity-labels-containers.md)]
197173

198174
#### 3. Publish your labels and educate your users
199175

0 commit comments

Comments
 (0)