openstreetmap / chef

Chef configuration management repo for configuring & maintaining the OpenStreetMap servers.
Apache License 2.0
102 stars 67 forks source link

Add docker hub login to avoid hub IP limits #685

Closed Firefishy closed 3 months ago

Firefishy commented 3 months ago

Workaround anonymous limits of Docker Hub registry by having the GHA login.

tomhughes commented 3 months ago

What login is that using though?

Firefishy commented 3 months ago

What login is that using though?

It is using a dedicated Docker Hub personal access token from my Docker Hub account with only "Public Repo Read-only" permission.

Firefishy commented 3 months ago

Looks like this isn't going to work, pull requests do not get access to GitHub Action secrets. https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ has some workarounds but they do not seem suitable.

Firefishy commented 3 months ago

I've now changed this PR to not run the login step when running from a PR: if: github.repository == 'openstreetmap/chef' && github.event_name != 'pull_request'

The PR is still useful because it will still trigger on non-forked branch pushes eg: master.