Skip to content
Open
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
14 changes: 12 additions & 2 deletions .github/workflows/shared-go-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
default: "latest"
type: string
timeout:
description: "Timeout in minutes for the lint job"
description: "Timeout in minutes passed to golangci-lint via --timeout"
Comment thread
onuryilmaz marked this conversation as resolved.
required: false
default: 10
type: number
Expand All @@ -37,13 +37,22 @@ on:
jobs:
lint:
runs-on: ${{ inputs.runs-on }}
timeout-minutes: ${{ inputs.timeout }}
permissions:
Comment thread
onuryilmaz marked this conversation as resolved.
contents: read
defaults:
run:
working-directory: ${{ inputs.working-directory }}
steps:
- name: Validate inputs
shell: bash
env:
TIMEOUT: ${{ inputs.timeout }}
run: |
Comment thread
onuryilmaz marked this conversation as resolved.
if ! echo "$TIMEOUT" | grep -qE '^[1-9][0-9]*$'; then
echo "ERROR: timeout must be a positive integer (got: '$TIMEOUT')"
exit 1
fi

- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

Expand All @@ -59,6 +68,7 @@ jobs:
with:
version: ${{ inputs.golangci-lint-version }}
working-directory: ${{ inputs.working-directory }}
args: --timeout=${{ inputs.timeout }}m

- name: Run govulncheck
if: inputs.enable-govulncheck == true
Expand Down