Skip to content

build(deps-dev): bump the storybook group across 1 directory with 7 updates #590

build(deps-dev): bump the storybook group across 1 directory with 7 updates

build(deps-dev): bump the storybook group across 1 directory with 7 updates #590

Workflow file for this run

name: PR Checks
on:
pull_request:
branches:
- '*'
permissions:
contents: write
pull-requests: write
repository-projects: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Dependencies 📦
run: yarn install
- name: Lint 🧼
run: yarn lint
- name: Test 🧪
run: yarn test
- name: SonarCloud 🔬
uses: sonarsource/sonarcloud-github-action@v2.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Build 🛠️
run: yarn build
- name: Build Storybook
run: yarn build:storybook
- name: Create and Upload Storybook to PR directory
run: |
PR_NUMBER="PR-${{ github.event.number }}"
git config user.name "evargast"
git config user.email "52969178+evargast@users.noreply.github.com"
# Fetch the existing gh-pages branch
git fetch origin gh-pages
# Checkout the existing gh-pages branch
git checkout gh-pages
# Remove the PR directory if it exists
rm -rf "${PR_NUMBER}"
# Create the PR directory
mkdir "${PR_NUMBER}"
# Copy the contents of dist-storybook to the directory
cp -r dist-storybook/* "${PR_NUMBER}/"
rm -rf node_modules # Explicitly remove the node_modules directory
rm -rf dist-storybook # Explicitly remove the dist-storybook directory
# Add, commit, and push changes
git add "${PR_NUMBER}/."
git commit -m "Update Storybook for ${PR_NUMBER}"
git push -f origin gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Add comment to the PR with Storybook URL
run: |
PR_NUMBER="${{ github.event.number }}"
COMMENT_BODY="🎨 Storybook -> https://opensource.adobe.com/react-spectrum-charts/PR-${PR_NUMBER}"
curl -sSL \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-X POST \
-d '{"body":"'"${COMMENT_BODY}"'"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}