Skip to content

Commit

Permalink
add chatOpts help message workflow
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 committed Jul 24, 2023
1 parent 46822db commit 303c1c6
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/chatops-help.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "ChatOps help"

on:
pull_request:
types: [opened]

jobs:
dump_contexts_to_log:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/dump-context

print-help:
name: "print ChatOps help message"
runs-on: ubuntu-latest
steps:
- name: comment to PR
run: |
curl -o chatops_commands.md https://raw.githubusercontent.com/vdaas/vald/main/.github/chatops_commands.md
BODY=`cat chatops_commands.md | sed ':a;N;$!ba;s/\n/\\\\n/g'`
curl --include --verbose --fail \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-H "Authorization: token ${GITHUB_TOKEN}" \
--request POST \
--data "{\"body\": \"**[CHATOPS:HELP]** ChatOps commands.\\n${BODY}\"}" \
$API_URL
env:
GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }}
API_URL: ${{ github.event.pull_request.comments_url }}
PR_NUM: ${{ github.event.issue.number }}

0 comments on commit 303c1c6

Please sign in to comment.