Skip to content

Commit

Permalink
Don't attempt to log into aws or docker hub if there's no key configured
Browse files Browse the repository at this point in the history
  • Loading branch information
credfeto committed Oct 8, 2024
1 parent cdf1744 commit dfafb3f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/actions/docker-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,23 @@ runs:
uses: docker/[email protected]

- name: "Configure AWS Credentials"
if: inputs.AWS_REGION != ''
if: inputs.AWS_ACCESS_KEY_ID != ''
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{inputs.AWS_ACCESS_KEY_ID}}
aws-secret-access-key: ${{inputs.AWS_SECRET_ACCESS_KEY}}
aws-region: ${{inputs.AWS_REGION}}

- name: "Docker: Login to Docker Hub"
if: inputs.DOCKER_ACCESS_TOKEN != ''
uses: docker/[email protected]
with:
username: ${{inputs.DOCKER_USERNAME}}
password: ${{inputs.DOCKER_ACCESS_TOKEN}}
ecr: false

- name: "Docker: Login to AWS ECR"
if: inputs.AWS_ACCESS_KEY_ID != ''
uses: docker/[email protected]
with:
registry: ${{inputs.AWS_CONTAINER_REGISTRY}}
Expand Down

0 comments on commit dfafb3f

Please sign in to comment.