add workflow rule for test #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "ChatOps help" | |
on: | |
pull_request: | |
types: [opened] | |
# TODO: Delete it later. | |
push: | |
branches: | |
- "add-dump-action" | |
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 }} | |