Skip to content

Commit

Permalink
Set the UserAgent for Azure PowerShell (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
YanaXu authored Nov 3, 2023
1 parent 12f969a commit c87941d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ async function main() {
let actionName = 'AzurePowerShellAction';
let userAgentString = (!!userAgentPrefix ? `${userAgentPrefix}+` : '') + `GITHUBACTIONS_${actionName}_${usrAgentRepo}`;
core.exportVariable('AZURE_HTTP_USER_AGENT', userAgentString);
core.exportVariable('AZUREPS_HOST_ENVIRONMENT', userAgentString);

const inlineScript: string = core.getInput('inlineScript', { required: true });
azPSVersion = core.getInput('azPSVersion', { required: true }).trim().toLowerCase();
Expand Down Expand Up @@ -45,6 +46,7 @@ async function main() {
FileUtils.deleteFile(ScriptRunner.filePath);
// Reset AZURE_HTTP_USER_AGENT
core.exportVariable('AZURE_HTTP_USER_AGENT', userAgentPrefix);
core.exportVariable('AZUREPS_HOST_ENVIRONMENT', userAgentPrefix);
}
}

Expand Down

0 comments on commit c87941d

Please sign in to comment.