fix(Layout): fix panel header props type #2360
Workflow file for this run
This file contains hidden or 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: | |
| pull_request: | |
| paths-ignore: | |
| - '.changeset/**' | |
| - '.husky/**' | |
| concurrency: | |
| group: ci-pull-request=${{github.ref}}-1 | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read # Read-only access to repository contents | |
| issues: write # Write access to issues | |
| pull-requests: write # Write access to pull requests | |
| statuses: write # Write access to commit statuses | |
| actions: write # Required to trigger workflows | |
| jobs: | |
| build: | |
| name: 'Build' | |
| runs-on: ubuntu-latest | |
| env: | |
| NODE_OPTIONS: --max-old-space-size=4096 | |
| outputs: | |
| version: ${{ steps.version.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update Corepack | |
| run: npm i -g corepack@latest | |
| - name: Enable Corepack (pre) | |
| run: corepack enable | |
| - name: Prepare pnpm (pre) | |
| run: corepack prepare [email protected] --activate | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'pnpm' | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Prepare pnpm | |
| run: corepack prepare [email protected] --activate | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Set env | |
| run: echo "SHORT_SHA=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV | |
| - name: Increment canary | |
| run: npm version 0.0.0-canary-$SHORT_SHA --no-git-tag-version | |
| - name: Build project | |
| run: pnpm build | |
| - name: Get version | |
| id: version | |
| working-directory: ./dist | |
| run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: ./dist | |
| retention-days: 7 | |
| trigger-publish: | |
| name: 'Trigger canary publish' | |
| needs: build | |
| # On fork PRs the token is read-only and cannot create repository_dispatch. | |
| # Also, we intentionally don't expose a high-privilege token to untrusted PR code. | |
| if: github.actor == 'tenphi' && github.event.pull_request.head.repo.full_name == github.repository | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| actions: write | |
| steps: | |
| - name: Trigger publish workflow | |
| uses: actions/github-script@v6 | |
| with: | |
| # Use a dedicated token (PAT or GitHub App token) if provided; otherwise fall back to the workflow token. | |
| # The token must have access to create repository dispatch events in this repo. | |
| github-token: ${{ secrets.WORKFLOW_TRIGGER_TOKEN || github.token }} | |
| script: | | |
| await github.rest.repos.createDispatchEvent({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| event_type: 'publish-canary', | |
| client_payload: { | |
| pr_number: String(context.payload.pull_request.number), | |
| run_id: String(context.runId) | |
| } | |
| }) | |
| console.log('Triggered publish workflow for canary release') | |
| tests: | |
| name: 'Tests & lint' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update Corepack | |
| run: npm i -g corepack@latest | |
| - name: Enable Corepack (pre) | |
| run: corepack enable | |
| - name: Prepare pnpm (pre) | |
| run: corepack prepare [email protected] --activate | |
| - uses: actions/cache@v4 | |
| name: Download eslint cache | |
| with: | |
| path: | | |
| **/.eslintcache | |
| key: ${{ runner.os }}-eslint | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'pnpm' | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Prepare pnpm | |
| run: corepack prepare [email protected] --activate | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run the lint | |
| run: pnpm lint | |
| - name: Run the tests | |
| run: pnpm test:no-cache | |
| deploy-chromatic: | |
| name: 'Prepare Storybook for review & tests' | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: Chromatic staging | |
| url: ${{ steps.publish_chromatic.outputs.url }} | |
| env: | |
| CHROMATIC_RETRIES: 5 | |
| LOG_LEVEL: 'error' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Update Corepack | |
| run: npm i -g corepack@latest | |
| - name: Enable Corepack (pre) | |
| run: corepack enable | |
| - name: Prepare pnpm (pre) | |
| run: corepack prepare [email protected] --activate | |
| - uses: actions/cache@v4 | |
| name: Download storybook cache | |
| with: | |
| path: | | |
| **/node_modules/.cache | |
| key: ${{ runner.os }}-storybook-${{ github.run_id }} | |
| restore-keys: | | |
| ${{ runner.os }}-storybook | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'pnpm' | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Prepare pnpm | |
| run: corepack prepare [email protected] --activate | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Publish to Chromatic | |
| id: publish_chromatic | |
| uses: chromaui/action@v11 | |
| with: | |
| exitZeroOnChanges: true | |
| exitOnceUploaded: true | |
| onlyChanged: true | |
| debug: true | |
| token: ${{ github.token }} | |
| projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
| - name: Comment PR | |
| uses: actions/github-script@v6 | |
| with: | |
| github-token: ${{ github.token }} | |
| script: | | |
| const setMessage = require('${{ github.workspace }}/scripts/ci/set-message.cjs') | |
| await setMessage({ | |
| header: "## 🧪 Storybook is successfully deployed!", | |
| body: ` | |
| - 👀 Review changes: ${{ steps.publish_chromatic.outputs.url }} | |
| - 👨🎨 Preview storybook: ${{ steps.publish_chromatic.outputs.storybookUrl }} | |
| `, | |
| github, | |
| repo: context.repo, | |
| prNumber: context.payload.pull_request.number | |
| }) |