mirror of
https://github.com/actions/github-script.git
synced 2026-02-07 19:47:26 +00:00
Fix user-agent to handle empty string correctly
Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
This commit is contained in:
parent
b588811d63
commit
c36bdc0a3a
2 changed files with 3 additions and 2 deletions
2
dist/index.js
vendored
2
dist/index.js
vendored
|
|
@ -36267,7 +36267,7 @@ async function main() {
|
||||||
const retries = parseInt(core.getInput('retries'));
|
const retries = parseInt(core.getInput('retries'));
|
||||||
const exemptStatusCodes = parseNumberArray(core.getInput('retry-exempt-status-codes'));
|
const exemptStatusCodes = parseNumberArray(core.getInput('retry-exempt-status-codes'));
|
||||||
const [retryOpts, requestOpts] = getRetryOptions(retries, exemptStatusCodes, utils.defaults);
|
const [retryOpts, requestOpts] = getRetryOptions(retries, exemptStatusCodes, utils.defaults);
|
||||||
const baseUserAgent = userAgent || 'actions/github-script';
|
const baseUserAgent = userAgent === '' ? '' : userAgent || 'actions/github-script';
|
||||||
const finalUserAgent = getUserAgentWithOrchestrationId(baseUserAgent);
|
const finalUserAgent = getUserAgentWithOrchestrationId(baseUserAgent);
|
||||||
const opts = {
|
const opts = {
|
||||||
log: debug ? console : undefined,
|
log: debug ? console : undefined,
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,8 @@ async function main(): Promise<void> {
|
||||||
defaultGitHubOptions
|
defaultGitHubOptions
|
||||||
)
|
)
|
||||||
|
|
||||||
const baseUserAgent = userAgent || 'actions/github-script'
|
const baseUserAgent =
|
||||||
|
userAgent === '' ? '' : userAgent || 'actions/github-script'
|
||||||
const finalUserAgent = getUserAgentWithOrchestrationId(baseUserAgent)
|
const finalUserAgent = getUserAgentWithOrchestrationId(baseUserAgent)
|
||||||
|
|
||||||
const opts: Options = {
|
const opts: Options = {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue