Skip to content

Commit 4c8434d

Browse files
committed
Merge branch 'main' of github.com:slsa-framework/example-package
2 parents d86f5fd + a4555dd commit 4c8434d

8 files changed

+25
-14
lines changed

.github/workflows/scripts/e2e-report-failure.sh

+12-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@ THIS_FILE=$(e2e_this_file)
77

88
e2e_create_issue_failure_body
99

10-
ISSUE_ID=$(gh -R "$ISSUE_REPOSITORY" issue list --label "e2e" --label "type:bug" --state open -S "$THIS_FILE" --json number | jq '.[0]' | jq -r '.number' | jq 'select (.!=null)')
10+
if [[ -z "$TITLE" ]]; then
11+
# Replace `.`` by ` `, remove the last 3 characters `yml` and remove the e2e prefix
12+
TITLE=$(echo "$THIS_FILE" | sed -e 's/\./ /g' | rev | cut -c4- | rev | cut -c5-)
13+
fi
14+
if [[ -z "$WORKFLOW" ]]; then
15+
WORKFLOW=$(echo "$THIS_FILE" | cut -d '.' -f2)
16+
fi
17+
if [[ -z "$HEADER" ]]; then
18+
HEADER="e2e"
19+
fi
20+
ISSUE_ID=$(gh -R "$ISSUE_REPOSITORY" issue list --label "$HEADER" --label "type:bug" --state open -S "$THIS_FILE" --json number | jq '.[0]' | jq -r '.number' | jq 'select (.!=null)')
1121

1222
# Use the PAT_TOKEN if one is specified.
1323
# TODO(github.com/slsa-framework/example-package/issues/52): Always use PAT_TOKEN
@@ -17,10 +27,7 @@ if [[ -z "$TOKEN" ]]; then
1727
fi
1828

1929
if [[ -z "$ISSUE_ID" ]]; then
20-
# Replace `.`` by ` `, remove the last 3 characters `yml` and remove the e2e prefix
21-
TITLE=$(echo "$THIS_FILE" | sed -e 's/\./ /g' | rev | cut -c4- | rev | cut -c5-)
22-
WORKFLOW=$(echo "$THIS_FILE" | cut -d '.' -f2)
23-
GH_TOKEN=$TOKEN gh -R "$ISSUE_REPOSITORY" issue create -t "[e2e]: $TITLE" -F ./BODY --label "e2e" --label "type:bug" --label "workflow:$WORKFLOW"
30+
GH_TOKEN=$TOKEN gh -R "$ISSUE_REPOSITORY" issue create -t "[$HEADER]: $TITLE" -F ./BODY --label "$HEADER" --label "type:bug" --label "workflow:$WORKFLOW"
2431
else
2532
GH_TOKEN=$TOKEN gh -R "$ISSUE_REPOSITORY" issue comment "$ISSUE_ID" -F ./BODY
2633
fi

.github/workflows/scripts/e2e-report-success.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ THIS_FILE=$(e2e_this_file)
77

88
e2e_create_issue_success_body
99

10-
ISSUE_ID=$(gh -R "$ISSUE_REPOSITORY" issue list --label "e2e" --label "type:bug" --state open -S "$THIS_FILE" --json number | jq '.[0]' | jq -r '.number' | jq 'select (.!=null)')
10+
if [[ -z "$HEADER" ]]; then
11+
HEADER="e2e"
12+
fi
13+
14+
ISSUE_ID=$(gh -R "$ISSUE_REPOSITORY" issue list --label "$HEADER" --label "type:bug" --state open -S "$THIS_FILE" --json number | jq '.[0]' | jq -r '.number' | jq 'select (.!=null)')
1115

1216
# Use the PAT_TOKEN if one is specified.
1317
# TODO(github.com/slsa-framework/example-package/issues/52): Always use PAT_TOKEN

.github/workflows/scripts/e2e.go.default.verify.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ verify_provenance_content() {
3030
has_assets=$(echo "$THIS_FILE" | cut -d '.' -f5 | grep -v noassets)
3131
TAG=$(echo "$THIS_FILE" | cut -d '.' -f5 | grep tag)
3232
# Note GO_MAIN and GO_DIR are set in the workflows as env variables.
33-
DIR="$PWD"
33+
DIR="$PWD/__PROJECT_CHECKOUT_DIR__"
3434
if [[ -n "$GO_DIR" ]]; then
3535
DIR="$DIR/$GO_DIR"
3636
fi
@@ -50,11 +50,11 @@ verify_provenance_content() {
5050
# First step is vendoring
5151
e2e_verify_predicate_buildConfig_step_command "0" "$ATTESTATION" "[\"mod\",\"vendor\"]"
5252
e2e_verify_predicate_buildConfig_step_env "0" "$ATTESTATION" "[]"
53-
e2e_verify_predicate_buildConfig_step_workingDir "0" "$ATTESTATION" "$DIR/__PROJECT_CHECKOUT_DIR__"
53+
e2e_verify_predicate_buildConfig_step_workingDir "0" "$ATTESTATION" "$DIR"
5454

5555
# Second step is the actual compilation.
5656
e2e_verify_predicate_buildConfig_step_env "1" "$ATTESTATION" "[\"GOOS=linux\",\"GOARCH=amd64\",\"GO111MODULE=on\",\"CGO_ENABLED=0\"]"
57-
e2e_verify_predicate_buildConfig_step_workingDir "1" "$ATTESTATION" "$DIR/__PROJECT_CHECKOUT_DIR__"
57+
e2e_verify_predicate_buildConfig_step_workingDir "1" "$ATTESTATION" "$DIR"
5858

5959
if [[ -z "$LDFLAGS" ]]; then
6060
e2e_verify_predicate_buildConfig_step_command "1" "$ATTESTATION" "[\"build\",\"-mod=vendor\",\"-trimpath\",\"-tags=netgo\",\"-o\",\"$BINARY\"]"

e2e/dummy

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Fri Oct 21 04:26:48 PM UTC 2022
1+
Mon Oct 24 08:20:47 AM UTC 2022
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Thu Oct 27 04:00:43 UTC 2022
1+
Thu Oct 27 04:04:36 UTC 2022
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Thu Oct 27 04:06:55 UTC 2022
1+
Thu Oct 27 04:06:55 UTC 2022
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Fri Oct 21 06:46:29 UTC 2022
1+
Thu Oct 27 06:33:18 UTC 2022
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Fri Oct 21 20:00:54 UTC 2022
1+
Thu Oct 27 04:09:19 UTC 2022

0 commit comments

Comments
 (0)