From d805a272ed037b2a05669160873490d0c685b4ca Mon Sep 17 00:00:00 2001 From: Nogic <24802730+nogic1008@users.noreply.github.com> Date: Sun, 5 May 2024 20:30:16 +0900 Subject: [PATCH] refactor(ci): split Compare and Report Summary job (#973) --- .github/workflows/nodejs.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 557d7de5..257f804f 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -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: @@ -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