Skip to content

Adding logs to surface AZ-CLI and powershell errors - #171

Merged
Balaga Gayatri (BALAGA-GAYATRI) merged 31 commits into
master-logsfrom
master-logs-working
Nov 12, 2021
Merged

Adding logs to surface AZ-CLI and powershell errors#171
Balaga Gayatri (BALAGA-GAYATRI) merged 31 commits into
master-logsfrom
master-logs-working

Conversation

@BALAGA-GAYATRI

Copy link
Copy Markdown
Contributor

Screenshot 2021-11-11 at 5 50 02 PM

Comment thread lib/main.js
catch (error) {
if (!isAzCLISuccess) {
core.error("Az CLI Login failed. Please check the credentials. For more information refer https://aka.ms/create-secrets-for-GitHub-workflows");
core.setFailed("Az CLI Login failed. Please check the credentials. For more information refer https://aka.ms/create-secrets-for-GitHub-workflows");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the difference between .error and .setFailed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

execution stops here if setFailed otherwise it continues.

Comment thread src/main.ts Outdated
failOnStdErr: true,
listeners: {
stderr: (data: Buffer) => {
let error = data.toString().replace('ERROR','');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want to replace only the starting ERROR substring and not all ERROR mentions right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made small change. It replaces only first occurrence in the beginning of the message now.

Comment thread src/main.ts Outdated
listeners: {
stderr: (data: Buffer) => {
let error = data.toString().replace('ERROR','');
if(error && error.trim().length !== 0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: formatting - space after if

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@BALAGA-GAYATRI
Balaga Gayatri (BALAGA-GAYATRI) merged commit 029c4e4 into master-logs Nov 12, 2021
Balaga Gayatri (BALAGA-GAYATRI) added a commit that referenced this pull request Nov 15, 2021
* cherry pick changes

* added audience field option in input params

* added js

* removed extra spaces

* Adding logs to surface AZ-CLI and powershell errors (#171)

* removing token logs
Balaga Gayatri (BALAGA-GAYATRI) added a commit that referenced this pull request Nov 15, 2021
* cherry pick changes

* added audience field option in input params

* added js

* removed extra spaces

* Adding logs to surface AZ-CLI and powershell errors (#171)

* removing token logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants