Skip to content

Commit d101d16

Browse files
authored
Merge branch 'Azure:main' into main
2 parents 7a156d2 + cef77fd commit d101d16

File tree

3 files changed

+112
-0
lines changed

3 files changed

+112
-0
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,3 +323,5 @@
323323
/src/azext_gallery-service-artifact/ @rohitbhoopalam
324324

325325
/src/azext_durabletask/ @RyanLettieri
326+
327+
/src/acat @qinqingxu @Sherylueen @yongxin-ms @wh-alice

.github/policies/resourceManagement.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,6 +2564,9 @@ configuration:
25642564
- mentionUsers:
25652565
mentionees:
25662566
- kenieva
2567+
- shanhix1
2568+
- calecarter
2569+
- mentat9
25672570
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
25682571
assignMentionees: False
25692572
- if:
@@ -6784,5 +6787,35 @@ configuration:
67846787
users:
67856788
- ReaNAiveD
67866789
description: '[k8s-runtime] Auto assign labels and reviewers based on PR title/description.'
6790+
- if:
6791+
- payloadType: Issues
6792+
- or:
6793+
- titleContains:
6794+
pattern: '[Aa]z acat'
6795+
isRegex: True
6796+
- bodyContains:
6797+
pattern: '[Aa]z acat'
6798+
isRegex: True
6799+
- titleContains:
6800+
pattern: '\b([Aa]cat)\b'
6801+
isRegex: True
6802+
- bodyContains:
6803+
pattern: '\b([Aa]cat)\b'
6804+
isRegex: True
6805+
- or:
6806+
- isAction:
6807+
action: Opened
6808+
then:
6809+
- addLabel:
6810+
label: Auto-Assign
6811+
- addLabel:
6812+
label: Acat
6813+
- assignTo:
6814+
users:
6815+
- qinqingxu
6816+
- Sherylueen
6817+
- yongxin-ms
6818+
- wh-alice
6819+
description: '[Acat] auto assign labels and users based on issue description.'
67876820
onFailure:
67886821
onSuccess:

.github/workflows/CCOA.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: CCOA
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- reopened
8+
branches:
9+
- main
10+
11+
permissions:
12+
pull-requests: write
13+
14+
jobs:
15+
add_label_and_comment:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Check current date securely
20+
id: date_check
21+
run: |
22+
# Define the block date (Jan 7, 2025)
23+
BLOCK_DATE=$(date -d "2025-01-07" +%s)
24+
25+
# Get the current date in seconds
26+
CURRENT_DATE=$(date +%s)
27+
28+
# Validate the dates and safely output the result
29+
if [ "$CURRENT_DATE" -lt "$BLOCK_DATE" ]; then
30+
echo "continue=true" >> "$GITHUB_OUTPUT"
31+
else
32+
echo "continue=false" >> "$GITHUB_OUTPUT"
33+
fi
34+
35+
- name: Add do-not-merge label
36+
if: steps.date_check.outputs.continue == 'true'
37+
uses: actions/github-script@v7
38+
with:
39+
github-token: ${{ secrets.GITHUB_TOKEN }}
40+
script: |
41+
github.rest.issues.addLabels({
42+
owner: context.repo.owner,
43+
repo: context.repo.repo,
44+
issue_number: context.issue.number,
45+
labels: ["do-not-merge"],
46+
})
47+
48+
- name: Comment on PR
49+
if: steps.date_check.outputs.continue == 'true'
50+
uses: actions/github-script@v7
51+
with:
52+
github-token: ${{ secrets.GITHUB_TOKEN }}
53+
script: |
54+
// Fetch existing comments
55+
const comments = await github.rest.issues.listComments({
56+
owner: context.repo.owner,
57+
repo: context.repo.repo,
58+
issue_number: context.issue.number,
59+
});
60+
61+
// Check if the specific comment already exists
62+
const existingComment = comments.data.find(comment =>
63+
comment.body.includes("🚫All pull requests will be blocked to merge until Jan 6, 2025 due to CCOA")
64+
);
65+
66+
if (existingComment) {
67+
console.log("Comment already exists. Skipping...");
68+
} else {
69+
console.log("No comment found. Adding a new one...");
70+
// Add a new comment
71+
await github.rest.issues.createComment({
72+
owner: context.repo.owner,
73+
repo: context.repo.repo,
74+
issue_number: context.issue.number,
75+
body: "🚫All pull requests will be blocked to merge until Jan 6, 2025 due to CCOA",
76+
});
77+
}

0 commit comments

Comments
 (0)