feat(M20DS-28): add switch component #1976
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
| # .github/workflows/chromatic.yml | |
| # Workflow name | |
| # https://www.chromatic.com/docs/github-actions | |
| name: 'Chromatic' | |
| # Event for the workflow | |
| on: | |
| pull_request: | |
| types: [opened, ready_for_review, review_requested, reopened, synchronize, closed] | |
| permissions: | |
| contents: read | |
| # List of jobs | |
| jobs: | |
| chromatic-deployment: | |
| runs-on: ubuntu-24.04 | |
| # When a check is required if it is skipped by the on condition, it remains pending on pull request | |
| # To avoid this we must use the if condition on job: | |
| # - It always runs on pull request when it is merged (closed + merged) from branch that isn't in ignored ones | |
| # and the destination branch is main or develop | |
| # - It always runs on pull request if the pull request isn't in draft mode and there isn't a push and the pull request doesn't come | |
| # from branches ignored | |
| if: > | |
| ( | |
| github.event.action == 'closed' && | |
| github.event.pull_request.merged == true && | |
| !startsWith(github.head_ref, 'renovate/') && | |
| !startsWith(github.head_ref, 'dependabot') && | |
| !startsWith(github.head_ref, 'main') && | |
| !startsWith(github.head_ref, 'ci/') && | |
| !startsWith(github.head_ref, 'build/') && | |
| !startsWith(github.head_ref, 'chore/') && | |
| (github.base_ref == 'main' || github.base_ref == 'develop') | |
| ) || | |
| ( | |
| github.event.action != 'closed' && | |
| github.event.action != 'synchronize' && | |
| github.event.pull_request.draft == false && | |
| !startsWith(github.head_ref, 'renovate/') && | |
| !startsWith(github.head_ref, 'dependabot') && | |
| !startsWith(github.head_ref, 'release/') && | |
| !startsWith(github.head_ref, 'hotfix/') && | |
| !startsWith(github.head_ref, 'main') && | |
| !startsWith(github.head_ref, 'ci/') && | |
| !startsWith(github.head_ref, 'build/') && | |
| !startsWith(github.head_ref, 'chore/') | |
| ) | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install dependencies | |
| run: yarn | |
| - name: Publish to Chromatic | |
| uses: chromaui/action@f191a0224b10e1a38b2091cefb7b7a2337009116 # v16.0.0 | |
| with: | |
| projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
| onlyChanged: true | |
| skip: 'dependabot/*|renovate/*|release/*|hotfix/*' | |
| autoAcceptChanges: 'main' |