Skip to content

Conversation

sj26
Copy link
Member

@sj26 sj26 commented Dec 5, 2024

I tried to use bk to push a package from GitHub Actions, but it failed:

https://github.com/sj26/github-actions-to-buildkite-packages-javascript-example/actions/runs/12133880719/job/33830150889#step:5:8

Screenshot 2024-12-05 at 11 52 33 AM

Pretty sure that message comes via spinErr. I think it's because it's trying to start spinner, and that seems to require a tty.

This wraps up the spinner a little function that checks if we're in a tty when starting a spinner, and skips the spinner if we're not.

I haven't attempted tests yet .. I just wanted to see if this works.

I did test this locally and could still push a package and it showed a spinner. I couldn't figure out quickly how to simulate a no-tty environment.

Otherwise this command fails with errors about missing a tty when used
in scripts on CI.
@sj26 sj26 self-assigned this Dec 5, 2024
@sj26 sj26 merged commit b7388db into main Dec 5, 2024
1 check passed
@sj26 sj26 deleted the only-spinner-when-tty branch December 5, 2024 01:06
@sj26
Copy link
Member Author

sj26 commented Dec 5, 2024

Sadly this doesn't seem to have fixed my issue 😢

)

func SpinWhile(name string, action func()) error {
if isatty.IsTerminal(os.Stdout.Fd()) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This should have been:

Suggested change
if isatty.IsTerminal(os.Stdout.Fd()) {
if !isatty.IsTerminal(os.Stdout.Fd()) {

@sj26 sj26 mentioned this pull request Jul 6, 2025
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