Skip to content

Update provider.go

Update provider.go #2

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: golangci-lint
# Controls when the workflow will run
on:
pull_request:
paths:
- tencentcloud/**
- .github/**
- .golangci.yml
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
golangci-lint:
# The type of runner that the job will run on
runs-on: macos-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-go@v3
with:
go-version-file: .go-version
#go-version: '1.21'
cache: false
- name: Get list of changed files
id: getDiffFile
run: |
prefix=$(pwd)
files=$(git diff --name-only origin/master | grep '^tencentcloud/.*\.go$' | xargs)
files_with_prefix=""
for file in $files; do
files_with_prefix="$files_with_prefix $prefix/$file"
done
echo "::set-output name=files::$files_with_prefix"
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.63.4
# working-directory: .
args: --new-from-rev=origin/master -v ${{ steps.getDiffFile.outputs.files }}
#args: --enable-all --max-same-issues=0 --max-issues-per-linter=0 --new-from-rev=origin/master -v