Skip to content

Commit fea5535

Browse files
authored
Update golangci-lint.yml
1 parent 3a83555 commit fea5535

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ jobs:
3333
go-version-file: .go-version
3434
#go-version: '1.21'
3535
cache: false
36+
37+
- name: Get root path
38+
id: getRootPath
39+
run: |
40+
echo "::set-output path=$(pwd)"
41+
shell: bash
3642

3743
- name: Get list of changed files
3844
id: getDiffFile
3945
run: |
40-
prefix=$(pwd)
41-
files=$(git diff --name-only origin/master | grep '^tencentcloud/.*\.go$' | xargs)
42-
files_with_prefix=""
43-
for file in $files; do
44-
files_with_prefix="$files_with_prefix $prefix/$file"
45-
done
46-
echo "::set-output name=files::$files_with_prefix"
46+
echo "::set-output name=files::$(git diff --name-only origin/master | grep '^tencentcloud/.*\.go$' | xargs)"
4747
shell: bash
4848

4949
- name: Check for changed Go files
@@ -64,6 +64,6 @@ jobs:
6464
uses: golangci/golangci-lint-action@v3
6565
with:
6666
version: v1.63.4
67-
# working-directory: .
67+
working-directory: ${{ steps.getRootPath.outputs.path }}
6868
args: --new-from-rev=origin/master -v ${{ steps.getDiffFile.outputs.files }}
6969
#args: --enable-all --max-same-issues=0 --max-issues-per-linter=0 --new-from-rev=origin/master -v

0 commit comments

Comments
 (0)