Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add gcloudRun and use getExecOutput #77

Merged
merged 1 commit into from
Feb 3, 2022
Merged

Conversation

sethvargo
Copy link
Member

@sethvargo sethvargo commented Feb 2, 2022

This introduces two new functions gcloudRun and gcloudRunJSON which use @actions/exec#getExecOutput to execute gcloud commands. It checks if the command was successful. On failure, it throws an error and prints stderr and stdout. On success, it returns the stderr, stdout, and combined output.

Introducing this function also greatly simplified some of the other functions, which had a lot of duplicate logic, etc.

I also refactored the tests a bit to reduce the number of times we actually install gcloud. This made the tests significantly faster (~5min -> ~40s).

@sethvargo
Copy link
Member Author

@bharathkkb these failing tests are also failing at HEAD (I just kicked off that run). It looks like a credential or something might have expired?

@bharathkkb
Copy link
Contributor

bharathkkb commented Feb 3, 2022

@sethvargo yup they expired. I will update in a bit

@sethvargo
Copy link
Member Author

Yay green now :)

@sethvargo
Copy link
Member Author

@bharathkkb can I get a 👍 on this now that tests are passing?

src/index.ts Outdated Show resolved Hide resolved
src/index.ts Show resolved Hide resolved
This introduces two new functions `gcloudRun` and `gcloudRunJSON` which use `@actions/exec#getExecOutput` to execute gcloud commands. It checks if the command was successful. On failure, it throws an error and prints stderr and stdout. On success, it returns the stderr, stdout, and combined output.

Introducing this function also greatly simplified some of the other functions, which had a lot of duplicate logic, etc.
@sethvargo sethvargo merged commit 3778ef8 into main Feb 3, 2022
@sethvargo sethvargo deleted the sethvargo/output branch February 3, 2022 20:59
This was referenced Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants