From 8c8cf20169f18e0048a0a3d82cd0aa185ae53d4f Mon Sep 17 00:00:00 2001 From: Ryunosuke Muramatsu Date: Fri, 17 Nov 2023 13:53:53 +0900 Subject: [PATCH] Update diff count output in check-all-lint-rule-diffs.yaml workflow. --- .github/workflows/check-all-lint-rule-diffs.yaml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/check-all-lint-rule-diffs.yaml b/.github/workflows/check-all-lint-rule-diffs.yaml index 0aac822..f22a752 100644 --- a/.github/workflows/check-all-lint-rule-diffs.yaml +++ b/.github/workflows/check-all-lint-rule-diffs.yaml @@ -13,7 +13,7 @@ jobs: name: Check diff runs-on: ubuntu-latest outputs: - has-diff: ${{ steps.output.outputs.has-diff }} + diff_count: ${{ steps.output.outputs.diff_count }} steps: - uses: actions/checkout@v4 - name: Set up Go @@ -23,22 +23,16 @@ jobs: cache-dependency-path: './diffscrape/go.sum' - name: Run go working-directory: ./diffscrape/cmd/rules - run: | - pwd - go run main.go - - uses: technote-space/get-diff-action@v6 - with: - FILES: | - all_lint_rules.yaml - - name: Output diff + run: go run main.go + - name: output diff id: output - run: echo "has-diff=${{ env.GIT_DIFF }}" >> "$GITHUB_OUTPUT" + run: echo "diff_count=$(git diff --name-only origin/${{ github.base_ref }} HEAD --relative=packages/altive_lints/lib | wc -l)" >> "$GITHUB_OUTPUT" commit: name: Commit diff runs-on: ubuntu-latest needs: [diff] - if: ${{ needs.diff.outputs.has-diff }} + if: ${{ needs.diff.outputs.diff_count != '0' }} steps: - uses: actions/checkout@v4 - name: Create branch