From 3032c7770e0eecb104ac902577cffb61f636ffa7 Mon Sep 17 00:00:00 2001 From: Choi JunHo Date: Mon, 1 Jul 2024 23:14:39 +0900 Subject: [PATCH] Chore: Add permissions to github actions and pr comments --- .github/workflows/storybook.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index cd4588b..50ad78c 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -8,13 +8,17 @@ on: branches: - main +permissions: + contents: write + pull-requests: write + jobs: - build: + storybook-build: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 @@ -23,6 +27,12 @@ jobs: with: node-version: '18' + - name: Cache Dependencies + uses: actions/cache@v3 + with: + path: '**/node_modules' + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-storybook + - name: Install dependencies run: npm install @@ -30,6 +40,14 @@ jobs: run: npm run build-storybook - name: Publish to Chromatic + id: chromatic env: CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} run: npx chromatic --project-token=$CHROMATIC_PROJECT_TOKEN + + - name: Comment on PR + uses: thollander/actions-comment-pull-request@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + message: 'storybook 확인좀용: ${{ steps.chromatic.outputs.storybookUrl }}'