-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (52 loc) · 1.56 KB
/
client_pull_request.yml
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
53
54
55
56
57
58
59
60
61
name: Build and Comment
on:
pull_request:
branches:
- dev
paths:
- "client/**"
jobs:
build-client:
runs-on: ubuntu-latest
env:
working-directory: ./client
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
- name: Install dependencies
run: yarn
working-directory: ${{ env.working-directory }}
- name: Build project
run: yarn build
working-directory: ${{ env.working-directory }}
comment-client:
needs: build-client
runs-on: ubuntu-latest
if: always()
steps:
# 성공 시 코멘트
- name: Add a comment on success
if: ${{ needs.build.result == 'success' }}
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '빌드를 성공했습니다! :tada:'
})
# 실패 시 코멘트
- name: Add a comment on failure
if: ${{ needs.build.result == 'failure' }}
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '빌드를 실패했습니다. :x: 자세한 내용은 로그를 참고해주세요.'
})