Skip to content

Commit 1b83a6e

Browse files
authored
feat: Update ref check for BYOB Actions (#2563)
closes #2550 Signed-off-by: laurentsimon <[email protected]>
1 parent 54f2d21 commit 1b83a6e

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

.github/workflows/scripts/pre-release/references.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,19 @@ if [[ "$results" != "" ]]; then
8282
exit 1
8383
fi
8484

85+
# Verify our Actions are referenced by the release tag in BYOB actions.
86+
results=$(
87+
find internal/builders/ -maxdepth 2 -name '*.yaml' -o -name '*.yml' -type f -print0 |
88+
xargs -0 grep -Pn "slsa-framework/slsa-github-generator/.*@(?!$RELEASE_TAG)" |
89+
sed 's/\(.*:\) *uses:.*\(\/.*\)/\1 [...]\2/' ||
90+
true
91+
)
92+
if [[ "$results" != "" ]]; then
93+
echo "Some Actions are not referenced via the correct release tag \"$RELEASE_TAG\" in BYOB actions"
94+
echo "$results"
95+
exit 1
96+
fi
97+
8598
# Verify the Maven Actions use the correct builder ref.
8699
results=$(
87100
find actions/maven/ internal/builders/maven/ -name '*.yaml' -o -name '*.yml' -type f -print0 |

.github/workflows/scripts/pre-submit.actions/references.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ if [[ "$results" != "" ]]; then
5858
exit 1
5959
fi
6060

61+
# Verify our Actions are referenced at main in BYOB actions.
62+
results=$(
63+
find internal/builders/ -maxdepth 2 -name '*.yaml' -o -name '*.yml' -type f -print0 |
64+
xargs -0 grep -P "slsa-framework/slsa-github-generator/.*@(?!main)" ||
65+
true
66+
)
67+
if [[ "$results" != "" ]]; then
68+
echo "Some Actions are not referenced at main in BYOB Actions"
69+
echo "$results"
70+
exit 1
71+
fi
72+
6173
# Verify the Maven Actions use the correct builder ref.
6274
results=$(
6375
find actions/maven/ internal/builders/maven/ -name '*.yaml' -o -name '*.yml' -type f -print0 |
@@ -69,5 +81,3 @@ if [[ "$results" != "" ]]; then
6981
echo "$results"
7082
exit 1
7183
fi
72-
73-

internal/builders/bazel/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ runs:
7575

7676
- name: Generate Artifacts
7777
id: generate-artifacts
78-
uses: slsa-framework/slsa-github-generator/.github/actions/secure-upload-folder@v1.8.0
78+
uses: slsa-framework/slsa-github-generator/.github/actions/secure-upload-folder@main
7979
with:
8080
name: "${{ steps.rng.outputs.random }}-binaries"
8181
path: "./bazel_builder_binaries_to_upload_to_gh_7bc972367cb286b7f36ab4457f06e369" # path-to-artifact(s)

0 commit comments

Comments
 (0)