github.com/goreleaser/goreleaser@v1.25.1/scripts/entrypoint.sh (about) 1 #!/usr/bin/env bash 2 3 if [ -n "$DOCKER_USERNAME" ] && [ -n "$DOCKER_PASSWORD" ]; then 4 echo "Login to the docker..." 5 echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin "$DOCKER_REGISTRY" 6 fi 7 8 # Workaround for github actions when access to different repositories is needed. 9 # Github actions provides a GITHUB_TOKEN secret that can only access the current 10 # repository and you cannot configure it's value. 11 # Access to different repositories is needed by brew for example. 12 13 if [ -n "$GORELEASER_GITHUB_TOKEN" ] ; then 14 export GITHUB_TOKEN=$GORELEASER_GITHUB_TOKEN 15 fi 16 17 if [ -n "$GITHUB_TOKEN" ]; then 18 # Log into GitHub package registry 19 echo "$GITHUB_TOKEN" | docker login docker.pkg.github.com -u docker --password-stdin 20 echo "$GITHUB_TOKEN" | docker login ghcr.io -u docker --password-stdin 21 fi 22 23 if [ -n "$CI_REGISTRY_PASSWORD" ]; then 24 # Log into GitLab registry 25 echo "$CI_REGISTRY_PASSWORD" | docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" --password-stdin 26 fi 27 28 # prevents git from complaining about unsafe dir, specially when using github actions 29 git config --global --add safe.directory $PWD 30 31 # shellcheck disable=SC2068 32 exec goreleaser $@