You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if [[ "${{steps.user-agent-default.outputs.result}}" != "$expected"* ]]; then
160
-
echo $'::error::\u274C' "Expected user-agent to start with '$expected', got ${{steps.user-agent-default.outputs.result}}"
164
+
expected="actions/github-script"
165
+
if ! matches_user_agent "${{steps.user-agent-default.outputs.result}}" "$expected"; then
166
+
echo $'::error::\u274C' "Expected user-agent to start with '$expected' and include 'octokit-core.js/', got ${{steps.user-agent-default.outputs.result}}"
161
167
exit 1
162
168
fi
163
169
echo "- Validating user-agent set to a value"
164
-
expected="foobar octokit-core.js/"
165
-
if [[ "${{steps.user-agent-set.outputs.result}}" != "$expected"* ]]; then
166
-
echo $'::error::\u274C' "Expected user-agent to start with '$expected', got ${{steps.user-agent-set.outputs.result}}"
170
+
expected="foobar"
171
+
if ! matches_user_agent "${{steps.user-agent-set.outputs.result}}" "$expected"; then
172
+
echo $'::error::\u274C' "Expected user-agent to start with '$expected' and include 'octokit-core.js/', got ${{steps.user-agent-set.outputs.result}}"
167
173
exit 1
168
174
fi
169
175
echo "- Validating user-agent set to an empty string"
170
-
expected="actions/github-script octokit-core.js/"
171
-
if [[ "${{steps.user-agent-empty.outputs.result}}" != "$expected"* ]]; then
172
-
echo $'::error::\u274C' "Expected user-agent to start with '$expected', got ${{steps.user-agent-empty.outputs.result}}"
176
+
expected="actions/github-script"
177
+
if ! matches_user_agent "${{steps.user-agent-empty.outputs.result}}" "$expected"; then
178
+
echo $'::error::\u274C' "Expected user-agent to start with '$expected' and include 'octokit-core.js/', got ${{steps.user-agent-empty.outputs.result}}"
173
179
exit 1
174
180
fi
175
181
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
0 commit comments