Skip to content

Commit 6defb81

Browse files
committed
Update quality-assurance.yaml workflow to get number of commits in push
Signed-off-by: James Bradlee <[email protected]>
1 parent 3b1fa7d commit 6defb81

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/quality-assurance.yaml

+10-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,17 @@ jobs:
2020
lint:
2121
runs-on: ubuntu-latest
2222
steps:
23-
- name: Checkout
23+
- name: Get number of commits in push
24+
id: payload
25+
if: github.event_name == 'push'
26+
env:
27+
COMMITS: ${{ toJson(github.event.commits) }}
28+
run: |
29+
echo "commit_length=$(echo $COMMITS | jq '. | length')" >> $GITHUB_OUTPUT
30+
- name: Checking out ${{ steps.payload.outputs.commit_length || '1' }} commits
2431
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: ${{ steps.payload.outputs.commit_length || '1' }}
2534
- name: Setup Ktlint
2635
uses: ./.github/actions/setup-ktlint
2736
- run: |

0 commit comments

Comments
 (0)