Skip to content

Commit

Permalink
Chore: Add permissions to github actions and pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
swgvenghy committed Jul 1, 2024
1 parent 5a031fc commit 3032c77
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -23,13 +27,27 @@ 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

- name: Build Storybook
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 }}'

0 comments on commit 3032c77

Please sign in to comment.