File tree Expand file tree Collapse file tree 3 files changed +57
-4
lines changed
Expand file tree Collapse file tree 3 files changed +57
-4
lines changed Original file line number Diff line number Diff line change 5555 run : |
5656 set -euo pipefail
5757 checksum_file=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type=="Checksum") | .path')
58- echo "hashes=$(cat $checksum_file | base64 -w0)" >> "$GITHUB_OUTPUT"
58+ if $checksum_file != *"osv-reporter"
59+ echo "hashes=$(cat $checksum_file | base64 -w0)" >> "$GITHUB_OUTPUT"
60+ fi
5961 provenance :
6062 needs : [goreleaser]
6163 permissions :
Original file line number Diff line number Diff line change 22 hooks :
33 - go mod tidy
44builds :
5- - env :
5+ - main : ./cmd/osv-scanner/
6+ id : osv-scanner
7+ binary : osv-scanner
8+ env :
69 # goreleaser does not work with CGO, it could also complicate
710 # usage by users in CI/CD systems like Terraform Cloud where
811 # they are unable to install libraries.
@@ -27,7 +30,22 @@ builds:
2730 # Further testing before supporting arm
2831 # - arm
2932 - arm64
30- main : ./cmd/osv-scanner/
33+ - main : ./cmd/osv-reporter/
34+ id : osv-reporter
35+ binary : osv-reporter
36+ env : # osv-reporter for github action
37+ - CGO_ENABLED=0
38+ - GO111MODULE=on
39+ mod_timestamp : " {{ .CommitTimestamp }}"
40+ flags :
41+ - -trimpath
42+ ldflags :
43+ # prettier-ignore
44+ - ' -s -w -X github.com/google/osv-scanner/internal/version.OSVVersion={{.Version}} -X main.commit={{.Commit}} -X main.date={{.CommitDate}}'
45+ goos :
46+ - linux
47+ goarch :
48+ - amd64
3149
3250dockers :
3351 # Arch: amd64
@@ -68,8 +86,10 @@ dockers:
6886 # Github Action
6987 - image_templates :
7088 - " ghcr.io/google/osv-scanner-action:{{ .Tag }}"
71- dockerfile : action.dockerfile
89+ dockerfile : goreleaser- action.dockerfile
7290 use : buildx
91+ extra_files :
92+ - exit_code_redirect.sh
7393 build_flag_templates :
7494 - " --pull"
7595 - " --label=org.opencontainers.image.title=osv-scanner-action"
Original file line number Diff line number Diff line change 1+ # Copyright 2024 Google LLC
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ FROM alpine:3.19@sha256:51b67269f354137895d43f3b3d810bfacd3945438e94dc5ac55fdac340352f48
16+ RUN apk --no-cache add \
17+ ca-certificates \
18+ git \
19+ bash
20+
21+ # Allow git to run on mounted directories
22+ RUN git config --global --add safe.directory '*'
23+
24+ WORKDIR /root/
25+ COPY ./osv-scanner ./
26+ COPY ./osv-reporter ./
27+ COPY ./exit_code_redirect.sh ./
28+
29+ ENV PATH="${PATH}:/root"
30+
31+ ENTRYPOINT ["bash" , "/root/exit_code_redirect.sh" ]
You can’t perform that action at this time.
0 commit comments