Skip to content

Commit

Permalink
Update quality-assurance.yaml workflow to get number of commits in push
Browse files Browse the repository at this point in the history
Signed-off-by: James Bradlee <[email protected]>
  • Loading branch information
testersen committed Apr 1, 2024
1 parent 3b1fa7d commit 6defb81
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/quality-assurance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,17 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Get number of commits in push
id: payload
if: github.event_name == 'push'
env:
COMMITS: ${{ toJson(github.event.commits) }}
run: |
echo "commit_length=$(echo $COMMITS | jq '. | length')" >> $GITHUB_OUTPUT
- name: Checking out ${{ steps.payload.outputs.commit_length || '1' }} commits
uses: actions/checkout@v4
with:
fetch-depth: ${{ steps.payload.outputs.commit_length || '1' }}
- name: Setup Ktlint
uses: ./.github/actions/setup-ktlint
- run: |
Expand Down

0 comments on commit 6defb81

Please sign in to comment.