Skip to content
unlock

GitHub Action

ECR Login

1.0.0 Latest version

ECR Login

unlock

ECR Login

Docker login for AWS ECR private

Installation

Copy and paste the following snippet into your .yml file.

              

- name: ECR Login

uses: thalesvon/ecr-login@1.0.0

Learn more about this action in thalesvon/ecr-login

Choose a version

ECR login docker action

Actions Status

This action gets a login string to AWS ECR and returns as an output of the action.

This action is only intended to be used for the command aws ecr get-login. For other awscli commands, use actions/aws/cli

Inputs

There are no inputs defined on actions.yml. Everything you write on args: is passed to the entrypoint. It is mandatory to pass AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. Configure both as secrets

Outputs

login-string

Docker Login string. It looks like this:

docker login -u AWS -p <pass> <ecr-url>

Example usage

    - name: 'Get Login to AWS ECR'
      id: ecr-login
      uses: thalesvon/ecr-login@master
      env:
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_DEFAULT_OUTPUT: json
        AWS_REGION: us-east-1
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      with:
        args: 'get-login --no-include-email --region ${AWS_REGION}'
    - name: 'Docker Login'
      run: ${{ steps. ecr-login.outputs.login-string }}