Skip to content

fix: use github runner token when calling the api, to prevent rate li…#124

Merged
gmpinder merged 2 commits intoblue-build:mainfrom
b-:patch-1
Dec 17, 2025
Merged

fix: use github runner token when calling the api, to prevent rate li…#124
gmpinder merged 2 commits intoblue-build:mainfrom
b-:patch-1

Conversation

@b-
Copy link
Copy Markdown
Contributor

@b- b- commented Dec 11, 2025

…miting

Sometimes the runner can get rate-limited during the step where it calls the API to determine the repo tag. This fixes that by passing the runner's github token as an authentication token.

@b- b- requested review from gmpinder and xynydev as code owners December 11, 2025 02:02
@gmpinder
Copy link
Copy Markdown
Member

I think this would be more secure if you put the token into an environment variable and use that instead.

@b-
Copy link
Copy Markdown
Contributor Author

b- commented Dec 11, 2025

Huh, TIL curl can interpolate env vars in headers! let me update...

xynydev
xynydev previously approved these changes Dec 11, 2025
@gmpinder
Copy link
Copy Markdown
Member

You can't use single quotes that doesn't get expanded

@gmpinder
Copy link
Copy Markdown
Member

Huh, TIL curl can interpolate env vars in headers! let me update...

It's not curl doing it. It's the Shell program doing it. It expands the variable before passing it into the command. The reason why I suggest putting it in the environment variable is to prevent it from being templated into the GitHub script directly.

Copy link
Copy Markdown
Member

@gmpinder gmpinder left a comment

Choose a reason for hiding this comment

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

Above comments

Sometimes the runner can get rate-limited during the step where it
calls the API to determine the latest tag. This fixes that by passing
the runner's github token as an authentication token.

Using curl's built-in variable support, we can avoid passing the
plaintext secret on the command line as an argument, thus avoiding the
theoretical security issue of someone being able to view the command
line args using `ps`.
@b-
Copy link
Copy Markdown
Contributor Author

b- commented Dec 13, 2025

Huh, TIL curl can interpolate env vars in headers! let me update...

It's not curl doing it. It's the Shell program doing it. It expands the variable before passing it into the command. The reason why I suggest putting it in the environment variable is to prevent it from being templated into the GitHub script directly.

Sorry, I misread the docs, but what I was trying to do was prevent the variable from being expanded by the shell.

In general it's considered bad practice to pass a secret as a plaintext command line arg, because the secret will show up to anything running ps. I think github uses separate runners anyway, but I was trying to avoid that.

In any case, I did completely misread how to pass a variable in a header, but I got it right this time :)

@b- b- requested a review from gmpinder December 13, 2025 05:40
@b-
Copy link
Copy Markdown
Contributor Author

b- commented Dec 17, 2025

Omg sorry I forgot to push my local fix

@gmpinder gmpinder merged commit c2fc4f6 into blue-build:main Dec 17, 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.

3 participants