Skip to content

Commit 6316ac2

Browse files
committed
Update AddPRComment.yml
1 parent fa7a447 commit 6316ac2

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

.github/workflows/AddPRComment.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
11
on:
22
pull_request_target:
33
types: [opened]
4-
branches:
5-
- dev
6-
- release
74

8-
permissions: {}
5+
permissions:
6+
pull-requests: write
97

108
jobs:
119
thank-user:
12-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-20.04
1311
name: Say thanks for the PR
1412
steps:
15-
- name: Comment on PR
13+
- name: get message
1614
env:
17-
PR_NUMBER: ${{ github.event.pull_request.number }}
18-
REPO: ${{ github.repository }}
19-
REPO_TOKEN: ${{ secrets.CLI_BOT }}
15+
TITLE: ${{ github.event.pull_request.title }}
2016
run: |
21-
message='Thank you for your contribution! We will review the pull request and get back to you soon.'
22-
23-
# Comment on the PR using GitHub API
24-
curl -X POST \
25-
-H "Authorization: token $REPO_TOKEN" \
26-
-H "Accept: application/vnd.github.v3+json" \
27-
https://api.github.com/repos/$REPO/issues/$PR_NUMBER/comments \
28-
-d "{\"body\": \"$message\"}"
17+
pwd
18+
message=$(echo "$TITLE" | grep -oP '[{\[][^}\]]+[}\]]' | sed 's/{\|}\|\[\|\]//g')
19+
echo "Message to be posted: $message end."
20+
echo "message=$message" >> $GITHUB_ENV

0 commit comments

Comments
 (0)