Skip to content

Commit eb4feac

Browse files
authored
add git hook notice (#30706)
1 parent 8a499ff commit eb4feac

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

.github/template/git-hooks-note.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
The git hooks are available for **azure-cli** and **azure-cli-extensions** repos. They could help you run required checks before creating the PR.
2+
3+
Please sync the latest code with latest dev branch (for **azure-cli**) or main branch (for **azure-cli-extensions**).
4+
After that please run the following commands to enable git hooks:
5+
6+
```bash
7+
pip install azdev --upgrade
8+
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
9+
10+
```
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Git Hook Notice
2+
on:
3+
pull_request_target:
4+
types: [opened]
5+
branches:
6+
- dev
7+
8+
permissions: {}
9+
10+
jobs:
11+
git-hook-notice:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
pull-requests: write
15+
name: Introduce git hook in developer env
16+
steps:
17+
- name: Checkout git hook notice message
18+
uses: actions/checkout@v4
19+
with:
20+
sparse-checkout: |
21+
.github/template/git-hooks-note.md
22+
- name: Comment on pull request
23+
uses: mshick/add-pr-comment@v2
24+
with:
25+
repo-token: ${{ secrets.GITHUB_TOKEN }}
26+
message-id: gitHookNoticeComment
27+
message-path: |
28+
.github/template/git-hooks-note.md

0 commit comments

Comments
 (0)