ci: fix user-agent test to handle orchestration ID

This commit is contained in:
Salman Muin Kayser Chishti
2026-04-09 19:24:48 +00:00
committed by GitHub
parent 81c6b78760
commit ff8117e5b7

View File

@@ -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