-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathaction.yml
More file actions
33 lines (31 loc) · 1.32 KB
/
action.yml
File metadata and controls
33 lines (31 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: golangci-lint-k6
description: Run golangci-lint with the k6 ruleset
runs:
using: composite
steps:
- name: Install Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6
with:
go-version: 1.25.x
check-latest: true
- name: Get golangci-lint version and download rules
shell: bash
env:
GITHUB_ACTION_REF: ${{ github.action_ref }}
GITHUB_HEAD_REF: ${{ github.head_ref }}
REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }}
run: |
branch="master"
if [ "${REPO_FULL_NAME}" = "grafana/k6" ]; then
branch="${GITHUB_ACTION_REF:-${GITHUB_HEAD_REF}}"
fi
rules_url="https://raw.githubusercontent.com/grafana/k6/${branch}/.golangci.yml"
echo "Downloading '${rules_url}' ..."
curl --silent --show-error --fail --no-location "${rules_url}" --output "${{ github.action_path }}/.golangci.yml"
echo "GolangCIVersion=$(head -n 1 "${{ github.action_path }}/.golangci.yml" | tr -d '# ')" >> "${GITHUB_OUTPUT}"
id: getenv
- name: golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: ${{ steps.getenv.outputs.GolangCIVersion }}
args: "--config=${{ github.action_path }}/.golangci.yml"