mirror of
https://github.com/actions/github-script.git
synced 2026-03-28 00:45:11 +00:00
Fix integration test: update user-agent validation to allow optional orchestration ID
Co-authored-by: angel-jiakou <115738347+angel-jiakou@users.noreply.github.com> Agent-Logs-Url: https://github.com/actions/github-script/sessions/d3f337be-6e6b-4278-a1da-9baf8f3c0263
This commit is contained in:
committed by
GitHub
parent
3841a7fa4e
commit
831f1a15f4
18
.github/workflows/integration.yml
vendored
18
.github/workflows/integration.yml
vendored
@@ -155,21 +155,21 @@ jobs:
|
|||||||
result-encoding: string
|
result-encoding: string
|
||||||
- run: |
|
- run: |
|
||||||
echo "- Validating user-agent default"
|
echo "- Validating user-agent default"
|
||||||
expected="actions/github-script octokit-core.js/"
|
actual="${{steps.user-agent-default.outputs.result}}"
|
||||||
if [[ "${{steps.user-agent-default.outputs.result}}" != "$expected"* ]]; then
|
if [[ ! "$actual" =~ ^actions/github-script([[:space:]]actions_orchestration_id/[^[:space:]]+)?[[:space:]]octokit-core\.js/ ]]; then
|
||||||
echo $'::error::\u274C' "Expected user-agent to start with '$expected', got ${{steps.user-agent-default.outputs.result}}"
|
echo $'::error::\u274C' "Expected user-agent to match 'actions/github-script [actions_orchestration_id/...] octokit-core.js/...', got $actual"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "- Validating user-agent set to a value"
|
echo "- Validating user-agent set to a value"
|
||||||
expected="foobar octokit-core.js/"
|
actual="${{steps.user-agent-set.outputs.result}}"
|
||||||
if [[ "${{steps.user-agent-set.outputs.result}}" != "$expected"* ]]; then
|
if [[ ! "$actual" =~ ^foobar([[:space:]]actions_orchestration_id/[^[:space:]]+)?[[:space:]]octokit-core\.js/ ]]; then
|
||||||
echo $'::error::\u274C' "Expected user-agent to start with '$expected', got ${{steps.user-agent-set.outputs.result}}"
|
echo $'::error::\u274C' "Expected user-agent to match 'foobar [actions_orchestration_id/...] octokit-core.js/...', got $actual"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "- Validating user-agent set to an empty string"
|
echo "- Validating user-agent set to an empty string"
|
||||||
expected="actions/github-script octokit-core.js/"
|
actual="${{steps.user-agent-empty.outputs.result}}"
|
||||||
if [[ "${{steps.user-agent-empty.outputs.result}}" != "$expected"* ]]; then
|
if [[ ! "$actual" =~ ^actions/github-script([[:space:]]actions_orchestration_id/[^[:space:]]+)?[[:space:]]octokit-core\.js/ ]]; then
|
||||||
echo $'::error::\u274C' "Expected user-agent to start with '$expected', got ${{steps.user-agent-empty.outputs.result}}"
|
echo $'::error::\u274C' "Expected user-agent to match 'actions/github-script [actions_orchestration_id/...] octokit-core.js/...', got $actual"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
|
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
|
||||||
|
|||||||
Reference in New Issue
Block a user