mirror of
https://github.com/actions/github-script.git
synced 2026-05-13 11:26:55 +00:00
ci: fix user-agent test to handle orchestration ID
This commit is contained in:
committed by
GitHub
parent
81c6b78760
commit
ff8117e5b7
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/"
|
ua="${{steps.user-agent-default.outputs.result}}"
|
||||||
if [[ "${{steps.user-agent-default.outputs.result}}" != "$expected"* ]]; then
|
if [[ "$ua" != "actions/github-script octokit-core.js/"* ]] && [[ "$ua" != "actions/github-script actions_orchestration_id/"* ]]; 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 start with 'actions/github-script', got $ua"
|
||||||
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/"
|
ua="${{steps.user-agent-set.outputs.result}}"
|
||||||
if [[ "${{steps.user-agent-set.outputs.result}}" != "$expected"* ]]; then
|
if [[ "$ua" != "foobar octokit-core.js/"* ]] && [[ "$ua" != "foobar actions_orchestration_id/"* ]]; 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 start with 'foobar', got $ua"
|
||||||
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/"
|
ua="${{steps.user-agent-empty.outputs.result}}"
|
||||||
if [[ "${{steps.user-agent-empty.outputs.result}}" != "$expected"* ]]; then
|
if [[ "$ua" != "actions/github-script octokit-core.js/"* ]] && [[ "$ua" != "actions/github-script actions_orchestration_id/"* ]]; 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 start with 'actions/github-script', got $ua"
|
||||||
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