Fix chormatic Action (#3548)
This commit is contained in:
1 parent
b9645b4de5
commit
7582d93d6a
1 file changed
-24
@@ -15,32 +15,8 @@ on:
|
||||
|
||||
# List of jobs
|
||||
jobs:
|
||||
check-if-ui-has-changed:
|
||||
runs-on: ubuntu-latest
|
||||
# Declare outputs for next jobs
|
||||
outputs:
|
||||
docs_changed: ${{ steps.check_file_changed.outputs.docs_changed }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
# Checkout as many commits as needed for the diff
|
||||
fetch-depth: 2
|
||||
- shell: pwsh
|
||||
id: check_file_changed
|
||||
run: |
|
||||
# Diff HEAD with the previous commit
|
||||
$diff = git diff --name-only HEAD^ HEAD
|
||||
|
||||
# Check if a file under /packages/ui or apps/storybook has been modified since the previous commit
|
||||
$SourceDiff = $diff | Where-Object { $_ -match '^packages/ui/' -or $_ -match '^apps/storybook/' }
|
||||
$HasDiff = $SourceDiff.Length -gt 0
|
||||
|
||||
# Set the output named "hasUiChanges"
|
||||
Write-Host "::set-output name=hasUiChanges::$HasDiff"
|
||||
chromatic-deployment:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ check-if-ui-has-changed ]
|
||||
if: needs.checkIfUiHasChanged.outputs.hasUiChanges== 'True'
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
Reference in new issue
Block a user