dadoonet / fscrawler

Elasticsearch File System Crawler (FS Crawler)
https://fscrawler.readthedocs.io/
Apache License 2.0
1.33k stars 295 forks source link

Fix Github Actions for build-docker with external contributors #1851

Open dadoonet opened 3 months ago

dadoonet commented 3 months ago

Describe the bug

When the build is ran for an external contribution, GA does not have access to our credentials and running docker login obviously can't work:

Run docker/login-action@v3
  with:
    ecr: auto
    logout: true
  env:
    JAVA_HOME: /opt/hostedtoolcache/Java_Adopt_jdk/17.0.10-7/x6[4](https://github.com/dadoonet/fscrawler/actions/runs/8466140957/job/23195719627?pr=1846#step:5:4)
    JAVA_HOME_17_X[6](https://github.com/dadoonet/fscrawler/actions/runs/8466140957/job/23195719627?pr=1846#step:5:6)4: /opt/hostedtoolcache/Java_Adopt_jdk/17.0.10-7/x64
    DOCKER_USERNAME: 
    DOCKER_TOKEN: 
Error: Username and password required

Expected behavior

Skip docker login with external contribution or find a way to pass our credentials to the build

Attachment

See https://github.com/dadoonet/fscrawler/actions/runs/8466140957/job/23195719627?pr=1846 as an example

12eddi commented 2 months ago

This error indicates that docker login action requires an username and a password, but it seems that these credentials are not provided in you environment variables. make sure that docker hub username and token ready, set the docker_username envoirmental variable to you Docker hub token, be sure that those environment variables are correctly passed to the docker login action. hope this helps