Fix CI pipeline #422
Workflow file for this run
This file contains 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: build | |
on: | |
pull_request: | |
jobs: | |
version: | |
runs-on: ubuntu-latest | |
if: startsWith(github.head_ref, 'renovate') == false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Detect Version for Docker | |
id: docker-version | |
run: echo "VERSION=$(SEP="-" scripts/version)" >> $GITHUB_OUTPUT | |
- name: Detect Version | |
id: version | |
run: echo "VERSION=$(scripts/version)" >> $GITHUB_OUTPUT | |
outputs: | |
docker-version: ${{ steps.docker-version.outputs.VERSION }} | |
version: ${{ steps.version.outputs.VERSION }} | |
build: | |
runs-on: ubuntu-latest | |
needs: | |
- version | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
# Force version to solve cache restore issue: https://github.com/actions/setup-go/issues/506 | |
go-version: 1.23.2 | |
check-latest: true # https://github.com/actions/setup-go#check-latest-version | |
cache: true # https://github.com/actions/setup-go#caching-dependency-files-and-build-outputs | |
- name: Build | |
run: go build -race ./... | |
- name: Install GoReleaser | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
version: latest | |
install-only: true | |
- name: Snapshot | |
run: make snapshot | |
env: | |
GORELEASER_CURRENT_TAG: ${{ needs.version.outputs.docker-version }} | |
- name: Grype scan | |
id: scan | |
uses: anchore/scan-action@v5 | |
with: | |
path: "." | |
fail-build: true | |
severity-cutoff: medium | |
output-format: sarif | |
- name: Upload SARIF report | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: ${{ steps.scan.outputs.sarif }} |