如何自动接受主分支的彩色github工作流中的更改



在Chromatic github工作流中,如果分支为main,如何使用CLI选项--auto-accept-changes自动接受所有更改?

我正在使用以下github chromatic工作流来部署我的应用程序的组件:

# .github/workflows/chromatic.yml
# Workflow name
name: 'Chromatic'
# Event for the workflow
on: push
# List of jobs
jobs:
chromatic-deployment:
# Operating System
runs-on: ubuntu-latest
# Job steps
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: yarn
# 👇 Adds Chromatic as a step in the workflow
- name: Publish to Chromatic
uses: chromaui/action@v1
# Chromatic GitHub Action options
with:
token: ${{ secrets.REPO_GITHUB_TOKEN }}
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

分支检测出现在文档中,但我不确定如何在yml文件中使用它,因为我的操作只是yarn

您有autoAcceptChanges,可以在其中定义标志或分支名称

- uses: chromaui/action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: 'Your chromatic project token'
buildScriptName: 'The npm script that builds your Storybook [build-storybook]'
storybookBuildDir: 'Provide a directory with your built storybook; use if you've already built your storybook'
allowConsoleErrors: 'Do not exit when runtime errors occur in storybook'
autoAcceptChanges: 'Automatically accept all changes in chromatic: boolean or branchname'
exitZeroOnChanges: 'Positive exit of action even when there are changes: boolean or branchname'
exitOnceUploaded: 'Exit with 0 once the built version has been sent to chromatic: boolean or branchname'

所以应该是:

# .github/workflows/chromatic.yml
# Workflow name
name: 'Chromatic'
# Event for the workflow
on: push
# List of jobs
jobs:
chromatic-deployment:
# Operating System
runs-on: ubuntu-latest
# Job steps
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: yarn
# 👇 Adds Chromatic as a step in the workflow
- name: Publish to Chromatic
uses: chromaui/action@v1
# Chromatic GitHub Action options
with:
token: ${{ secrets.REPO_GITHUB_TOKEN }}
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
autoAcceptChanges: 'main'

相关内容

  • 没有找到相关文章

最新更新