Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 5 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
name: CI

on:
workflow_dispatch: {}
pull_request: {}
push:
branches-ignore:
- main

jobs:

release-notes:
name: Release notes preview
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
steps:
- uses: open-turo/actions-release/release-notes-preview@v2
- uses: open-turo/actions-release/lint-release-notes@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
NPM_TOKEN: ${{ secrets.OPEN_TURO_NPM_TOKEN }}

lint:
name: Lint
Expand Down
17 changes: 15 additions & 2 deletions hooks/golang/golangci-lint-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,26 @@
lint_all() {
## Lets first report what version of golangi-lint is being run since it will
## not otherwise provide that information.
golangci-lint --version
version_output=$(golangci-lint --version)
echo "$version_output"

## Extract semver number (e.g., 1.54.2 or 2.1.2)
version=$(echo "$version_output" | grep -oP 'version \K[0-9]+\.[0-9]+\.[0-9]+')

## Use correct format flag depending on version
if [ "$(printf '%s\n' "$version" "1.55.0" | sort -V | head -n1)" = "1.55.0" ]; then
# version >= 1.55.0 → use --format
format_flag="--format"
else
# version < 1.55.0 → use --out-format
format_flag="--out-format"
fi

golangci-lint run \
--allow-parallel-runners \
--fix \
--verbose \
--out-format colored-line-number \
"$format_flag" colored-line-number \
--color always \
--enable errcheck \
--enable gosimple \
Expand Down
Loading