github.com/ahmet2mir/goreleaser@v0.180.3-0.20210927151101-8e5ee5a9b8c5/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  # shellcheck disable=SC2068
    24  goreleaser $@