From fcec5385b525971a4909c068847d4c0eac8961bf Mon Sep 17 00:00:00 2001 From: Xavi Date: Wed, 24 Jan 2024 12:23:52 -0500 Subject: [PATCH] Forked to remove hardcoded args --- .goreleaser.yml | 22 ++++++++++++++-------- main.go | 1 - plugin.yaml | 14 +++++++------- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 70ef8e4..573cca4 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -30,15 +30,21 @@ builds: - goos: darwin goarch: 386 archives: -- name_template: "{{ .ProjectName }}_{{.Version}}_{{ .Os }}_{{ .Arch }}" +- id: archive + name_template: >- + {{- .ProjectName }}_ + {{- .Version }}_ + {{- if eq .Os "darwin" }}macOS_ + {{- else if eq .Os "linux" }}Linux_ + {{- else }}{{ .Os }}_ + {{ end }} + {{- if eq .Arch "amd64" }}64bit + {{- else if eq .Arch "arm" }}ARM + {{- else if eq .Arch "arm64" }}ARM64 + {{- else }}{{ .Arch }} + {{ end }} builds: - trivy-webhook - replacements: - amd64: 64bit - arm: ARM - arm64: ARM64 - darwin: macOS - linux: Linux checksum: name_template: "checksums.txt" snapshot: @@ -49,4 +55,4 @@ changelog: exclude: - '^docs' - '^test' - - '^release' \ No newline at end of file + - '^release' diff --git a/main.go b/main.go index 5dedfc9..560cb40 100644 --- a/main.go +++ b/main.go @@ -71,7 +71,6 @@ func runScan(args []string, execCmd func(string, ...string) *exec.Cmd) ([]byte, if !containsSlice(trivyArgs, "format") { trivyArgs = append(trivyArgs, []string{"--format=json"}...) } - trivyArgs = append(trivyArgs, []string{"--quiet", "--timeout=30s"}...) log.Println("running trivy with args: ", trivyArgs) out, err := execCmd("trivy", trivyArgs...).CombinedOutput() diff --git a/plugin.yaml b/plugin.yaml index 7b0dadc..66ee968 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -1,6 +1,6 @@ name: "webhook" -repository: github.com/aquasecurity/trivy-plugin-webhook -version: "0.4.1" +repository: github.com/aetion/trivy-plugin-webhook +version: "0.4.2" usage: trivy webhook -- -- description: |- A Trivy plugin that sends the trivy results to a webhook endpoint. @@ -9,25 +9,25 @@ platforms: - selector: os: linux arch: amd64 - uri: https://github.com/aquasecurity/trivy-plugin-webhook/releases/download/v0.4.1/trivy-webhook_0.4.1_Linux_64bit.tar.gz + uri: https://github.com/aetion/trivy-plugin-webhook/releases/download/v0.4.2/trivy-webhook_0.4.2_Linux_64bit.tar.gz bin: ./trivy-webhook - selector: os: linux arch: arm - uri: https://github.com/aquasecurity/trivy-plugin-webhook/releases/download/v0.4.1/trivy-webhook_0.4.1_Linux_ARM.tar.gz + uri: https://github.com/aetion/trivy-plugin-webhook/releases/download/v0.4.2/trivy-webhook_0.4.2_Linux_ARM.tar.gz bin: ./trivy-webhook - selector: os: linux arch: arm64 - uri: https://github.com/aquasecurity/trivy-plugin-webhook/releases/download/v0.4.1/trivy-webhook_0.4.1_Linux_ARM64.tar.gz + uri: https://github.com/aetion/trivy-plugin-webhook/releases/download/v0.4.2/trivy-webhook_0.4.2_Linux_ARM64.tar.gz bin: ./trivy-webhook - selector: os: darwin arch: amd64 - uri: https://github.com/aquasecurity/trivy-plugin-webhook/releases/download/v0.4.1/trivy-webhook_0.4.1_macOS_64bit.tar.gz + uri: https://github.com/aetion/trivy-plugin-webhook/releases/download/v0.4.2/trivy-webhook_0.4.2_macOS_64bit.tar.gz bin: ./trivy-webhook - selector: os: darwin arch: arm64 - uri: https://github.com/aquasecurity/trivy-plugin-webhook/releases/download/v0.4.1/trivy-webhook_0.4.1_macOS_ARM64.tar.gz + uri: https://github.com/aetion/trivy-plugin-webhook/releases/download/v0.4.2/trivy-webhook_0.4.2_macOS_ARM64.tar.gz bin: ./trivy-webhook