default get_change_comments to unresolved threads #85
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: v2.12.2 | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - run: go build ./... | |
| - run: go test -race ./... | |
| release-dry-run: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - uses: docker/setup-qemu-action@v4 | |
| - uses: docker/setup-buildx-action@v4 | |
| - uses: goreleaser/goreleaser-action@v7 | |
| with: | |
| version: "~> v2" | |
| args: release --snapshot --clean | |
| - name: image smoke test | |
| # The image must start, print an actionable error, and exit non-zero | |
| # when required env is missing. | |
| run: | | |
| img=$(docker image ls --format '{{.Repository}}:{{.Tag}}' ghcr.io/gaijinentertainment/go-gerrit-mcp \ | |
| | grep -- '-amd64$' | head -n 1) | |
| [[ -n "$img" ]] || { echo "no snapshot image found" >&2; exit 1; } | |
| set +e | |
| out=$(docker run --rm "$img" 2>&1) | |
| code=$? | |
| set -e | |
| printf '%s\n' "$out" | |
| [[ "$code" -ne 0 ]] || { echo "image must exit non-zero without env" >&2; exit 1; } | |
| grep -q GERRIT_URL <<<"$out" || { echo "error must name the missing env var" >&2; exit 1; } | |
| # ci-ok is the single branch-protection gate: it fails when any job of the | |
| # run failed or was cancelled, and passes when every triggered job passed | |
| # or was skipped — so conditional jobs never need enumerating in rulesets. | |
| ci-ok: | |
| if: always() | |
| needs: [lint, test, release-dry-run] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: verify all jobs succeeded | |
| env: | |
| RESULTS: ${{ toJSON(needs.*.result) }} | |
| run: | | |
| echo "$RESULTS" | |
| [[ "$RESULTS" != *'"failure"'* && "$RESULTS" != *'"cancelled"'* ]] |