Skip to content

Commit

Permalink
refactor(ci): split Compare and Report Summary job (#973)
Browse files Browse the repository at this point in the history
  • Loading branch information
nogic1008 committed May 5, 2024
1 parent a03e574 commit d805a27
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/nodejs.yml
Expand Up @@ -114,8 +114,7 @@ jobs:
uses: actions/checkout@v4.1.4
with:
ref: ${{ vars.RELEASE_BRANCH }}
sparse-checkout: |
dist
sparse-checkout: dist
- name: Use Node.js ${{ vars.NODE_VERSION }}
uses: actions/setup-node@v4.0.2
with:
Expand All @@ -135,13 +134,15 @@ jobs:
- name: Compare
id: compare
continue-on-error: true
run: git diff --no-index --exit-code ./dist/ ./current/

- name: Report Summary
if: steps.compare.outcome == 'failure'
run: |
echo '# Compare ${{ github.sha }} to main' >> $GITHUB_STEP_SUMMARY
echo '# Compare ${{ github.sha }} to ${{ github.base_ref }}' >> $GITHUB_STEP_SUMMARY
echo '```diff' >> $GITHUB_STEP_SUMMARY
git diff --no-index ./dist/ ./current/ >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
git diff --no-index --exit-code ./dist/ ./current/
- name: Report diff
if: steps.compare.outcome == 'failure'
uses: actions/github-script@v7
Expand Down

0 comments on commit d805a27

Please sign in to comment.