Skip to content

Commit 4ff93d4

Browse files
committed
Merge branch 'sec-refactor' of github.com:HexmosTech/LiveReview into lince/git-lrc-selhosted
2 parents 866cda6 + 970aae0 commit 4ff93d4

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.github/workflows/sbom.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,36 @@ jobs:
2222
runs-on: ubuntu-latest
2323
permissions:
2424
contents: read
25+
env:
26+
SYFT_VERSION: v1.25.0
27+
SYFT_CACHE_DIR: ${{ runner.temp }}/syft-bin
2528
steps:
2629
- uses: actions/checkout@v4
2730

31+
- name: Compute syft cache epoch
32+
id: syft-cache-epoch
33+
run: echo "epoch=$(date -u +%Y-%m)" >> "$GITHUB_OUTPUT"
34+
35+
- name: Cache syft binary
36+
id: syft-cache
37+
uses: actions/cache@v4
38+
with:
39+
path: ${{ env.SYFT_CACHE_DIR }}/syft
40+
key: ${{ runner.os }}-syft-${{ env.SYFT_VERSION }}-${{ steps.syft-cache-epoch.outputs.epoch }}
41+
restore-keys: |
42+
${{ runner.os }}-syft-${{ env.SYFT_VERSION }}-
43+
2844
- name: Install syft
45+
if: steps.syft-cache.outputs.cache-hit != 'true'
46+
run: |
47+
mkdir -p "${SYFT_CACHE_DIR}"
48+
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b "${SYFT_CACHE_DIR}" "${SYFT_VERSION}"
49+
50+
- name: Add syft to PATH
51+
run: echo "${SYFT_CACHE_DIR}" >> "$GITHUB_PATH"
52+
53+
- name: Verify syft
2954
run: |
30-
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin v1.25.0
3155
syft version
3256
3357
- name: Ensure optional Make env file exists

0 commit comments

Comments
 (0)