Skip to content

Commit

Permalink
Increase git fetch, compare hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
gaby authored Nov 16, 2023
1 parent da12c55 commit 7685bbb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,19 @@ jobs:
steps:
- name: Fetch Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: set-matrix
run: |
# Get list of changed files
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }})
BASE_SHA=${{ github.event.pull_request.base.sha }}
HEAD_SHA=${{ github.event.pull_request.head.sha }}
FILES=$(git diff --name-only $BASE_SHA $HEAD_SHA)
else
FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }})
BEFORE_SHA=${{ github.event.before }}
AFTER_SHA=${{ github.event.after }}
FILES=$(git diff --name-only $BEFORE_SHA $AFTER_SHA)
fi
# Extract directories from changed files, convert to JSON and export
Expand All @@ -57,4 +63,3 @@ jobs:
workdir: ${{ matrix.modules }}
fail_on_error: true
filter_mode: nofilter
cache: false

0 comments on commit 7685bbb

Please sign in to comment.