-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (53 loc) · 1.58 KB
/
admin_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
62
name: Build and Comment
on:
pull_request:
branches:
- main
- dev
paths:
- "admin/**"
jobs:
build-admin:
runs-on: ubuntu-latest
env:
working-directory: ./admin
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-admin:
needs: build-admin
runs-on: ubuntu-latest
if: always()
steps:
# 성공 시 코멘트
- name: Add a comment on success
if: ${{ needs.build-admin.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-admin.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: 자세한 내용은 로그를 참고해주세요.'
})