Skip to content

Commit

Permalink
{CI} Update bot workflow (#7091)
Browse files Browse the repository at this point in the history
* update

* Update BlockPRMerge.yml

* Update BlockPRMerge.yml

* Update BlockPRMerge.yml

* Update BlockPRMerge.yml

* Update AddIssueComment.yml

* Update BlockPRMerge.yml
  • Loading branch information
wangzelin007 authored Dec 21, 2023
1 parent a3fb697 commit f321a93
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/policies/resourceManagement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5729,6 +5729,8 @@ configuration:
reviewer: zhoxing-ms
- requestReview:
reviewer: yanzhudd
- requestReview:
reviewer: qwuae1
- addLabel:
label: Auto-Assign
- assignTo:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/AddIssueComment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Say thanks for the Issue
steps:
- name: comment on the issue
uses: hasura/comment-progress@v2.2.0
uses: hasura/comment-progress@v2.3.0
with:
github-token: ${{ secrets.CLI_BOT }}
repository: 'Azure/azure-cli-extensions'
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/BlockPRMerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Block PR merging on "do-not-merge" label

on:
pull_request_target:
types: [labeled, unlabeled]

jobs:
block-merge:
runs-on: ubuntu-latest
steps:
- name: Check "do-not-merge" label
uses: actions/github-script@v7
with:
script: |
const labels = context.payload.pull_request.labels.map(label => label.name);
if (labels.includes("do-not-merge")) {
console.log("It is not allowed to merge a PR with 'do-not-merge' label.");
process.exit(1); // Exit with a non-zero status code to block merge
} else {
console.log("It is allowed to merge a PR without 'do-not-merge' label.");
}

0 comments on commit f321a93

Please sign in to comment.