httptoolkit / httptoolkit-ui

The UI of HTTP Toolkit
https://httptoolkit.com
GNU Affero General Public License v3.0
282 stars 106 forks source link

Added requierments that secret is present before running job #90

Open Starmania opened 11 months ago

Starmania commented 11 months ago

Builds with GitHub Action take times. And this is a cost. So now, if a secret variable or a environement variable is missing, it will not run the associated job.

pimterry commented 11 months ago

Thanks for this PR too, but I don't want to go down this specific route I think, for a few reasons:

Can you explain more about how you're using your fork, and how you'd like the CI job to work? Maybe there's an alternative solution that would stop things breaking, but still keep this code simple and avoid those risks.

Starmania commented 11 months ago

I understand your concerns, but why not so use a specific action to build and push to prod only when needed ?

Assigning these values like this makes it more likely these secrets could be accidentally leaked in build output

You don't need to worry for this, because GH filter log with secrets already defined as should never appear, at any moments. It's also why I made a separate job do handle this.

pimterry commented 11 months ago

I understand your concerns, but why not so use a specific action to build and push to prod only when needed ?

No, I definitely want to to stick with continuous deployment - automatically deploying everything at the moment it's committed is extremely effective for quick iteration, capturing rapid feedback, and finding bugs etc. It's an enormous boost to the project, and it saves a lot of working & planning too.

You don't need to worry for this, because GH filter log with secrets already defined as should never appear, at any moments. It's also why I made a separate job do handle this.

Yes, this is a nice backup, but it's a last-chance protection, it's not a security feature that's designed to be relied on (GitHub's own docs have repeated caveats warning about this and the cases where it won't work). There are many ways to leak secrets, and we should be careful with them where possible (and it is possible to do so here).


Can you explain more about how you're using your fork, and how you'd like the CI job to work for you personally? Maybe there's an alternative solution that would stop things breaking, but still keep this code simple and avoid those risks.