Skip to content

[Feat] 캐스퍼 쇼케이스에서 공유 링크 구현 #87

[Feat] 캐스퍼 쇼케이스에서 공유 링크 구현

[Feat] 캐스퍼 쇼케이스에서 공유 링크 구현 #87

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-client.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-client.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: 자세한 내용은 로그를 참고해주세요.'
})