forked from Azure/azure-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (27 loc) · 840 Bytes
/
AddPRComment.yml
File metadata and controls
29 lines (27 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
on:
pull_request_target:
types: [opened]
branches:
- dev
- release
permissions:
pull-requests: write
jobs:
thank-user:
runs-on: ubuntu-20.04
name: Say thanks for the PR
steps:
- name: get message
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
message=$(echo "$TITLE" | grep -oP '[{\[][^}\]]+[}\]]' | sed 's/{\|}\|\[\|\]//g')
echo "message=$message" >> $GITHUB_ENV
if [ -z $message ]; then
echo "message=$(echo 'Thank you for your contribution! We will review the pull request and get back to you soon.')" >> $GITHUB_ENV
fi
- name: comment on the pull request
uses: mshick/add-pr-comment@v2
with:
repo-token: ${{ secrets.CLI_BOT }}
message: "${{ env.message }}"