Skip to content

Commit

Permalink
Use process.env instead of core.exportvariable to set env (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoChilia committed Feb 22, 2024
1 parent 12aaf8e commit 4b557fa
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main.ts
Expand Up @@ -17,7 +17,7 @@ export async function main() {
let usrAgentRepo = crypto.createHash('sha256').update(`${process.env.GITHUB_REPOSITORY}`).digest('hex');
let actionName = 'AzureCLIAction';
let userAgentString = (!!prefix ? `${prefix}+` : '') + `GITHUBACTIONS/${actionName}_${usrAgentRepo}`;
core.exportVariable('AZURE_HTTP_USER_AGENT', userAgentString);
process.env.AZURE_HTTP_USER_AGENT = userAgentString;

var scriptFileName: string = '';
const CONTAINER_NAME = `MICROSOFT_AZURE_CLI_${getCurrentTime()}_CONTAINER`;
Expand Down Expand Up @@ -86,8 +86,6 @@ export async function main() {
await deleteFile(scriptFilePath);
console.log("cleaning up container...");
await executeDockerCommand(["rm", "--force", CONTAINER_NAME], true);
// Reset AZURE_HTTP_USER_AGENT
core.exportVariable('AZURE_HTTP_USER_AGENT', prefix);
}
};

Expand Down

0 comments on commit 4b557fa

Please sign in to comment.