-
-
Notifications
You must be signed in to change notification settings - Fork 9
52 lines (48 loc) · 1.76 KB
/
Copy pathComment_command.yml
File metadata and controls
52 lines (48 loc) · 1.76 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
name: Comment command
permissions: {}
on:
issue_comment:
types:
- created
jobs:
github-env:
name: GitHub Env Debug
permissions:
contents: read
uses: LizardByte/.github/.github/workflows/__call-github-env.yml@master
comment_command:
name: Comment command ${{ github.event.issue.number }}
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout
if:
github.actor != 'LizardByte-bot' &&
(
startsWith(github.event.comment.body, '@LizardByte-bot') ||
startsWith(github.event.comment.body, '/question')
)
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Comment command
env:
COMMENT_BODY: ${{ github.event.comment.body }}
COMMENT_AUTHOR_ID: ${{ github.event.comment.user.id }}
COMMENT_ID: ${{ github.event.comment.id }}
ISSUE_BODY: ${{ github.event.issue.body }}
ISSUE_AUTHOR_ID: ${{ github.event.issue.user.id }}
# https://regex101.com/r/vHEc61/1
YT_REGEX: '^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube(-nocookie)?\.com|youtu.be))(\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?$' # yamllint disable-line rule:line-length
if:
github.actor != 'LizardByte-bot' &&
(
startsWith(github.event.comment.body, '@LizardByte-bot') ||
startsWith(github.event.comment.body, '/question')
)
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ secrets.GH_BOT_TOKEN }}
script: |
const {run} = require('./src/github-scripts/comment-command.js')
await run({github, context})