Skip to content

Commit c36bdc0

Browse files
CopilotTingluoHuang
andcommitted
Fix user-agent to handle empty string correctly
Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
1 parent b588811 commit c36bdc0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36267,7 +36267,7 @@ async function main() {
3626736267
const retries = parseInt(core.getInput('retries'));
3626836268
const exemptStatusCodes = parseNumberArray(core.getInput('retry-exempt-status-codes'));
3626936269
const [retryOpts, requestOpts] = getRetryOptions(retries, exemptStatusCodes, utils.defaults);
36270-
const baseUserAgent = userAgent || 'actions/github-script';
36270+
const baseUserAgent = userAgent === '' ? '' : userAgent || 'actions/github-script';
3627136271
const finalUserAgent = getUserAgentWithOrchestrationId(baseUserAgent);
3627236272
const opts = {
3627336273
log: debug ? console : undefined,

src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ async function main(): Promise<void> {
3939
defaultGitHubOptions
4040
)
4141

42-
const baseUserAgent = userAgent || 'actions/github-script'
42+
const baseUserAgent =
43+
userAgent === '' ? '' : userAgent || 'actions/github-script'
4344
const finalUserAgent = getUserAgentWithOrchestrationId(baseUserAgent)
4445

4546
const opts: Options = {

0 commit comments

Comments
 (0)