π Card μ»΄ν¬λνΈ κ΅¬ν #48
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pull request | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
docker: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
# ν΄λΉ μ μ₯μμ μ½λλ₯Ό κ°μ Έμ΅λλ€. | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Node 16 λ²μ μ μ¬μ©ν©λλ€. | |
- name: Install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
cache-dependency-path: ./pnpm-lock.yaml | |
# package.jsonμ λͺ μλ μμ‘΄μ±μ μ€μΉν©λλ€. | |
- name: Install Dependencies | |
run: npm install | |
# μλ λ¨κ³μμ .env νμΌμ μμ±νκ³ μν¬λ¦Ώ κ°μ μ€μ ν©λλ€. | |
# - name: Set Environment Variables | |
# env: | |
# NEXT_PUBLIC_API_ADDRESS: ${{ secrets.NEXT_PUBLIC_API_ADDRESS }} | |
# NEXT_PUBLIC_CHANNEL_ID: ${{ secrets.NEXT_PUBLIC_CHANNEL_ID }} | |
# NEXT_PUBLIC_DISLIKE_CHANNEL_ID: ${{ secrets.NEXT_PUBLIC_DISLIKE_CHANNEL_ID }} | |
# run: | | |
# echo "NEXT_PUBLIC_API_ADDRESS=$NEXT_PUBLIC_API_ADDRESS" >> .env | |
# echo "NEXT_PUBLIC_CHANNEL_ID=$NEXT_PUBLIC_CHANNEL_ID" >> .env | |
# echo "NEXT_PUBLIC_DISLIKE_CHANNEL_ID=$NEXT_PUBLIC_DISLIKE_CHANNEL_ID" >> .env | |
# λΉλλ₯Ό μνν©λλ€. | |
- name: Build | |
run: npm run build | |
# ν μ€νΈλ₯Ό μνν©λλ€. | |
- name: Run tests | |
run: npm run test | |
- name: if_fail | |
uses: actions/github-script@v4 | |
with: | |
github-token: ${{ secrets.TOKEN_ACTIONS_CLIENT }} | |
script: | | |
const ref = "${{github.ref}}" | |
const pull_number = Number(ref.split("/")[2]) | |
console.log(pull_number, ref.split("/"), github.ref) | |
await github.pulls.createReview({ | |
...context.repo, | |
pull_number, | |
body : "ν μ€νΈμ½λλ₯Ό λ€μ νμΈν΄μ£ΌμΈμ. ", | |
event : "REQUEST_CHANGES" | |
}) | |
await github.pulls.update({ | |
...context.repo, | |
pull_number, | |
state: "closed" | |
}) | |
if: failure() |