Skip to content

Commit

Permalink
Update diff count output in
Browse files Browse the repository at this point in the history
check-all-lint-rule-diffs.yaml workflow.
  • Loading branch information
riscait committed Nov 17, 2023
1 parent 21e6739 commit 8c8cf20
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/check-all-lint-rule-diffs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8c8cf20

Please sign in to comment.