-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (42 loc) · 1.28 KB
/
checkbox.yaml
File metadata and controls
45 lines (42 loc) · 1.28 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
name: checkbox
on:
issues:
types:
- edited
jobs:
checkbox01:
runs-on: ubuntu-latest
if: ${{ contains(github.event.issue.labels.*.name, 'triage/test') }}
steps:
- name: debug
run: echo $CONTEXT
env:
CONTEXT: ${{ toJSON(github.event) }}
- id: checkbox01
continue-on-error: true
env:
REGEX: '\[[Xx]\] チェックボックス01'
run: |
diff <(echo '${{ github.event.changes.body.from }}') <(echo '${{ github.event.issue.body }}') | grep ">" | tee diff.txt
cat diff.txt
grep -E "$REGEX" diff.txt
- name: debug
run: echo $CONTEXT
env:
CONTEXT: ${{ toJSON(steps.checkbox01) }}
- name: Post Comment
if: steps.checkbox01.outcome == 'success'
uses: actions/github-script@v6.4.0
env:
MESSAGE: |
## 概要
- チェックボックス01 がチェックされました
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: process.env.MESSAGE
})