ci: Use setup-go to install Go v1.20 (#485)

This commit is contained in:
Edwin Kofler 2023-10-13 16:27:30 -07:00 committed by GitHub
parent c597bb3c20
commit 1e2b29201c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,11 +17,14 @@ jobs:
format: "json" format: "json"
- name: Check out code. - name: Check out code.
uses: actions/checkout@v2 uses: actions/checkout@v2
- uses: 'actions/setup-go@v4'
with:
go-version: '1.20'
- name: "Check EditorConfig Lint" - name: "Check EditorConfig Lint"
env: env:
EDITORCONFIG_FLAGS: '-disable-indent-size -disable-indentation' EDITORCONFIG_FLAGS: '-disable-indent-size -disable-indentation'
run: | run: |
sudo apt install -y jq golang sudo apt install -y jq
go install 'github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@latest' go install 'github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@latest'
readarray -t changed_files <<<"$(jq -r '.[]' <<<'${{ steps.files.outputs.added_modified }}')" readarray -t changed_files <<<"$(jq -r '.[]' <<<'${{ steps.files.outputs.added_modified }}')"
~/go/bin/editorconfig-checker ${{ env.EDITORCONFIG_FLAGS }} ${changed_files[@]} ~/go/bin/editorconfig-checker ${{ env.EDITORCONFIG_FLAGS }} ${changed_files[@]}