File tree 3 files changed +15
-1
lines changed
3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ inputs:
50
50
variant :
51
51
description : User specified variant of a set of tests being uploaded.
52
52
required : false
53
+ previous-step-outcome :
54
+ description : The outcome of the previous step in the workflow. Set this equal to steps.[id].outcome where `[id]` is the id of the corresponding test run.
55
+ required : false
53
56
54
57
runs :
55
58
using : composite
73
76
PR_TITLE : ${{ github.event.pull_request.title }}
74
77
HIDE_BANNER : ${{ inputs.hide-banner }}
75
78
VARIANT : ${{ inputs.variant }}
79
+ PREVIOUS_STEP_OUTCOME : ${{ inputs.previous-step-outcome }}
Original file line number Diff line number Diff line change @@ -74,6 +74,13 @@ BAZEL_BEP_PATH="${BAZEL_BEP_PATH-}"
74
74
ALLOW_MISSING_JUNIT_FILES_ARG=$( parse_bool " ${ALLOW_MISSING_JUNIT_FILES} " " --allow-missing-junit-files" )
75
75
HIDE_BANNER=$( parse_bool " ${HIDE_BANNER} " " --hide-banner" )
76
76
QUARANTINE_ARG=$( parse_bool " ${QUARANTINE} " " --use-quarantining" )
77
+ if [[ -n ${PREVIOUS_STEP_OUTCOME} ]]; then
78
+ if [[ ${PREVIOUS_STEP_OUTCOME} == " success" ]]; then
79
+ PREVIOUS_STEP_OUTCOME=" 0"
80
+ else
81
+ PREVIOUS_STEP_OUTCOME=" 1"
82
+ fi
83
+ fi
77
84
VARIANT=" ${VARIANT-} "
78
85
79
86
# CLI.
@@ -99,6 +106,7 @@ if [[ $# -eq 0 ]]; then
99
106
${REPO_HEAD_BRANCH: +--repo-head-branch " ${REPO_HEAD_BRANCH} " } \
100
107
--repo-root " ${REPO_ROOT} " \
101
108
--team " ${TEAM} " \
109
+ ${PREVIOUS_STEP_OUTCOME: +--test-process-exit-code=" ${PREVIOUS_STEP_OUTCOME} " } \
102
110
${ALLOW_MISSING_JUNIT_FILES_ARG} \
103
111
${HIDE_BANNER} \
104
112
${VARIANT: +--variant " ${VARIANT} " } \
113
121
${REPO_HEAD_BRANCH: +--repo-head-branch " ${REPO_HEAD_BRANCH} " } \
114
122
--repo-root " ${REPO_ROOT} " \
115
123
--team " ${TEAM} " \
124
+ ${PREVIOUS_STEP_OUTCOME: +--test-process-exit-code=" ${PREVIOUS_STEP_OUTCOME} " } \
116
125
${ALLOW_MISSING_JUNIT_FILES_ARG} \
117
126
${HIDE_BANNER} \
118
127
${VARIANT: +--variant " ${VARIANT} " } \
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ test("Forwards inputs", async () => {
38
38
ALLOW_MISSING_JUNIT_FILES : "" ,
39
39
BAZEL_BEP_PATH : "" ,
40
40
HIDE_BANNER : "" ,
41
+ PREVIOUS_STEP_OUTCOME : "success" ,
41
42
} ;
42
43
43
44
const scriptPath = path . resolve ( repoRoot , "script.sh" ) ;
@@ -57,7 +58,7 @@ test("Forwards inputs", async () => {
57
58
}
58
59
expect ( { stdout, stderr, exit_code } ) . toMatchObject ( {
59
60
stdout :
60
- "upload --junit-paths junit.xml --org-url-slug org --token token --repo-root --team" ,
61
+ "upload --junit-paths junit.xml --org-url-slug org --token token --repo-root --team --test-process-exit-code=0 " ,
61
62
stderr : `+ [[ 0.0.0 == \\l\\a\\t\\e\\s\\t ]]
62
63
+ [[ -f ./trunk-analytics-cli ]]
63
64
+ chmod +x ./trunk-analytics-cli
You can’t perform that action at this time.
0 commit comments