-
Notifications
You must be signed in to change notification settings - Fork 3
34 lines (28 loc) · 1 KB
/
slash-command.yml
File metadata and controls
34 lines (28 loc) · 1 KB
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
30
31
32
33
34
name: Slash Commands
on:
issue_comment:
types: [created]
permissions:
contents: read
pull-requests: write
actions: write
jobs:
dispatch:
name: Dispatch
runs-on: ubuntu-latest
if: >-
github.event.issue.pull_request &&
startsWith(github.event.comment.body, '/') &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)
steps:
- name: Dispatch /prerelease
if: startsWith(github.event.comment.body, '/prerelease')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions \
-f content='rocket' --silent
PR_NUMBER="${{ github.event.issue.number }}"
gh workflow run prerelease.yml --repo "$GITHUB_REPOSITORY" --ref "${{ github.event.repository.default_branch }}" \
-f pr_number="$PR_NUMBER" \
-f comment_id="${{ github.event.comment.id }}"