Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ jobs:

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: list of changed files
id: getDiffFile
run: |
echo "::set-output name=files::$(git diff --name-only origin/master | grep '\.go$' | xargs)"
shell: bash

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
Expand All @@ -39,12 +33,31 @@ jobs:
go-version-file: .go-version
#go-version: '1.21'
cache: false

- name: Get list of changed files
id: getDiffFile
run: |
echo "::set-output name=files::$(git diff --name-only origin/master | grep '^tencentcloud/.*\.go$' | xargs)"
shell: bash

- name: Check for changed Go files
id: checkDiffFile
run: |
if [ -z "${{ steps.getDiffFile.outputs.files }}" ]; then
echo "No Go files changed."
exit 0
fi

- name: Print changed files
id: showDiffFile
run: |
echo "Changed Go files: ${{ steps.getDiffFile.outputs.files }}"

# Runs a set of commands using the runners shell
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.48.0
version: v1.63.4
#version: v1.54
working-directory: ./tencentcloud
args: --new-from-rev=origin/master -v ${{ steps.getDiffFile.outputs.files }}
Expand Down
Loading