Skip to content

Update Postgres Exporter version to 0.12.1 PGO-42 #1658

Update Postgres Exporter version to 0.12.1 PGO-42

Update Postgres Exporter version to 0.12.1 PGO-42 #1658

Workflow file for this run

name: Linters
on:
pull_request:
branches:
- master
jobs:
documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Some versions of Ubuntu have an awk that does not recognize POSIX classes.
# Log the version of awk and abort when it cannot match space U+0020.
# - https://bugs.launchpad.net/ubuntu/+source/mawk/+bug/69724
- run: awk -W version && awk '{ exit 1 != match($0, /[[:space:]]/) }' <<< ' '
- run: |
find docs/content -not -type d -not -name crd.md -print0 | xargs -0 awk '
BEGIN { print "::add-matcher::.github/actions/awk-matcher.json" }
/[[:space:]]$/ { errors++; print FILENAME ":" FNR " error: Trailing space" }
/TODO/ { errors++; print FILENAME ":" FNR " error: Found TODO. Try running hack/create-todo-patch.sh" }
END { print "::remove-matcher owner=awk::" }
END { exit errors != 0 }
'
documentation-crd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# The `documentation-crd` job only checks the crd.md for `TODO`,
# as some of the upstream documentation has trailing spaces
- run: |
find docs/content -name crd.md -print0 | xargs -0 awk '
BEGIN { print "::add-matcher::.github/actions/awk-matcher.json" }
/TODO/ { errors++; print FILENAME ":" FNR " error: Found TODO. Try running hack/create-todo-patch.sh" }
END { print "::remove-matcher owner=awk::" }
END { exit errors != 0 }
'
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with: { go-version: 1.x }
- uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout=5m
# Count issues reported by disabled linters. The command always
# exits zero to ensure it does not fail the pull request check.
- name: Count non-blocking issues
run: |
golangci-lint run --config .golangci.next.yaml \
--issues-exit-code 0 \
--max-issues-per-linter 0 \
--max-same-issues 0 \
--out-format json |
jq --sort-keys 'reduce .Issues[] as $i ({}; .[$i.FromLinter] += 1)' |
awk >> "${GITHUB_STEP_SUMMARY}" '
NR == 1 { print "```json" } { print } END { if (NR > 0) print "```" }
' || true