Skip to content

Commit a8b02bd

Browse files
committed
build: leave reaction on slash command comments
1 parent 81ff578 commit a8b02bd

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/slash_commands.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,35 @@ on:
2929
# Workflow jobs:
3030
jobs:
3131

32+
# Add a new job for adding the initial reaction
33+
add_initial_reaction:
34+
35+
# Define the type of virtual host machine:
36+
runs-on: ubuntu-latest
37+
38+
# Define the conditions under which the job should run:
39+
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib')
40+
41+
# Define the job's steps:
42+
steps:
43+
# Add initial reaction to the comment
44+
- name: 'Add initial reaction'
45+
run: |
46+
COMMENT="${{ github.event.comment.body }}"
47+
if [[ $COMMENT == "/stdlib help" || \
48+
$COMMENT == "/stdlib check-files" || \
49+
$COMMENT == "/stdlib update-copyright-years" || \
50+
$COMMENT == "/stdlib lint-autofix" || \
51+
$COMMENT == "/stdlib merge" || \
52+
$COMMENT == "/stdlib rebase"
53+
]]; then
54+
curl -X POST \
55+
-H "Accept: application/vnd.github.v3+json" \
56+
-H "Authorization: Bearer ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}" \
57+
"https://api.github.com/repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions" \
58+
-d '{"content":"eyes"}'
59+
fi
60+
3261
# Define a job for checking for required files:
3362
check_files:
3463

0 commit comments

Comments
 (0)