Skip to content

Commit 0317097

Browse files
authored
ci: use setup-bats in bump-trivy workflow (#494)
Signed-off-by: Nikita Pivkin <nikita.pivkin@smartforce.io>
1 parent b6643a2 commit 0317097

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

.github/workflows/bump-trivy.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ jobs:
2222
- name: Update Trivy versions
2323
run: make bump-trivy
2424

25+
- name: Setup Bats and bats libs
26+
id: setup-bats
27+
uses: bats-core/bats-action@3.0.1
28+
2529
- name: Update golden files
30+
env:
31+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
2632
run: make update-golden
2733

2834
- name: Create PR

.github/workflows/test.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@ jobs:
1616
- uses: actions/checkout@v4
1717

1818
- name: Setup Bats and bats libs
19-
uses: bats-core/bats-action@2.0.0
19+
id: setup-bats
20+
uses: bats-core/bats-action@3.0.1
2021

2122
- name: Install Trivy
2223
run: |
2324
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v${{ env.TRIVY_VERSION }}
2425
trivy --version
2526
2627
- name: Test
27-
run: bats --recursive --timing --verbose-run .
2828
env:
29-
TRIVY_CACHE_DIR: .cache
30-
TRIVY_DISABLE_VEX_NOTICE: true
31-
TRIVY_DEBUG: true
29+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
30+
run: make test

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
OS := $(shell uname)
22
SED = sed
3-
BATS_LIB_PATH = /usr/local/lib/
3+
BATS_LIB_PATH ?= /usr/local/lib/
44

55
ifeq ($(OS), Darwin)
66
SED = gsed
7-
BATS_LIB_PATH = /opt/homebrew/lib
7+
BATS_LIB_PATH ?= /opt/homebrew/lib
88
endif
99

1010
BATS_ENV := BATS_LIB_PATH=$(BATS_LIB_PATH) \

0 commit comments

Comments
 (0)