mirror of
https://github.com/actions/github-script.git
synced 2026-05-13 11:26:55 +00:00
Compare commits
2 Commits
copilot/68
...
copilot/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
831f1a15f4 | ||
|
|
3841a7fa4e |
20
.github/workflows/integration.yml
vendored
20
.github/workflows/integration.yml
vendored
@@ -154,24 +154,22 @@ jobs:
|
|||||||
return endpoint({}).headers['user-agent']
|
return endpoint({}).headers['user-agent']
|
||||||
result-encoding: string
|
result-encoding: string
|
||||||
- run: |
|
- run: |
|
||||||
# User-agent format: <prefix> [actions_orchestration_id/<id>] octokit-core.js/<version> ...
|
|
||||||
# When ACTIONS_ORCHESTRATION_ID is set, the orchestration ID is inserted after the prefix
|
|
||||||
echo "- Validating user-agent default"
|
echo "- Validating user-agent default"
|
||||||
ua="${{steps.user-agent-default.outputs.result}}"
|
actual="${{steps.user-agent-default.outputs.result}}"
|
||||||
if [[ "$ua" != "actions/github-script"* ]] || [[ "$ua" != *"octokit-core.js/"* ]]; 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 'actions/github-script' and contain 'octokit-core.js/', got $ua"
|
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"
|
||||||
ua="${{steps.user-agent-set.outputs.result}}"
|
actual="${{steps.user-agent-set.outputs.result}}"
|
||||||
if [[ "$ua" != "foobar"* ]] || [[ "$ua" != *"octokit-core.js/"* ]]; then
|
if [[ ! "$actual" =~ ^foobar([[:space:]]actions_orchestration_id/[^[:space:]]+)?[[:space:]]octokit-core\.js/ ]]; then
|
||||||
echo $'::error::\u274C' "Expected user-agent to start with 'foobar' and contain 'octokit-core.js/', got $ua"
|
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"
|
||||||
ua="${{steps.user-agent-empty.outputs.result}}"
|
actual="${{steps.user-agent-empty.outputs.result}}"
|
||||||
if [[ "$ua" != "actions/github-script"* ]] || [[ "$ua" != *"octokit-core.js/"* ]]; 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 'actions/github-script' and contain 'octokit-core.js/', got $ua"
|
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