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

Auto-Detect GitHub Actions #163

Merged
merged 2 commits into from
Dec 3, 2023
Merged

Auto-Detect GitHub Actions #163

merged 2 commits into from
Dec 3, 2023

Conversation

cpisciotta
Copy link
Owner

@cpisciotta cpisciotta commented Nov 29, 2023

Automatically detect when a developer uses xcbeautify on GitHub Actions. If renderer isn't overridden, use the GitHub Actions renderer.

@cpisciotta cpisciotta linked an issue Nov 29, 2023 that may be closed by this pull request
@cpisciotta cpisciotta requested a review from pepicrft November 29, 2023 15:52
@cpisciotta cpisciotta marked this pull request as ready for review November 29, 2023 15:53
@cpisciotta cpisciotta requested review from a team and waltflanagan November 29, 2023 15:53
Copy link
Collaborator

@pepicrft pepicrft left a comment

Choose a reason for hiding this comment

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

I implemented this for Tuist 😜

@@ -24,7 +24,7 @@ struct Xcbeautify: ParsableCommand {
var disableColoredOutput = (ProcessInfo.processInfo.environment["NO_COLOR"] != nil)

@Option(help: "Specify a renderer to format raw xcodebuild output ( options: terminal | github-actions ).")
var renderer: XcbeautifyLib.Renderer = .terminal
var renderer: Renderer = ProcessInfo.processInfo.environment["GITHUB_ACTIONS"] == "true" ? .gitHubActions : .terminal
Copy link
Collaborator

Choose a reason for hiding this comment

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

Very nit picky, but in Tuist we check for truthiness instead of "true". The check does a canse insensitive comparison against 1, yes, and true. I'd recommend doing the same here to make it more robust.

@cpisciotta cpisciotta enabled auto-merge December 3, 2023 18:53
@cpisciotta cpisciotta added this pull request to the merge queue Dec 3, 2023
Merged via the queue into main with commit 043ed32 Dec 3, 2023
2 checks passed
@cpisciotta cpisciotta deleted the AutoDetect branch December 3, 2023 19:08
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.

Autodetect GitHub Actions from Environment
2 participants