Behaviour
We are generating one-time login AWS tokens in our Actions workflow.
Theoretically, we don't need aws_access_key_id and aws_secret_access_key. We need only aws_session_token to login into ECR because it has all needed for AWS information.
In practice:
- docker/login-action <1.5: it worked fine to run the action without username, just passing registry url and
aws_session_token as password
- docker/login-action >=1.5: the action validates presence of username param, which we don't have.
Steps to reproduce this issue
- Generate aws_session_token
- Pass it to
docker/login-action in password param, set registry param to be ecr url.
- Run Action @v1.5.0
Expected behaviour
Docker gets logged into ECR.
Actual behaviour
Error: Input required and not supplied: username
Configuration
# ...
# Previously we've generated AWS_SESSION_TOKEN using 3rd party tool (Okta)
- name: Extract AWS session token by profile name
id: get_aws_credentials
run: |
AWS_SESSION_TOKEN=`python -c 'from boto3 import Session; print(Session().get_credentials().get_frozen_credentials().token)'`
echo "::add-mask::$AWS_SESSION_TOKEN"
echo "::set-output name=token::$AWS_SESSION_TOKEN
- name: Login into ECR
uses: docker/login-action@v1.5.0
with:
registry: ${{ steps.get_ecr_url.outputs.ecr_url }}
password: ${{ steps.get_aws_credentials.outputs.token }}
# ...
Behaviour
We are generating one-time login AWS tokens in our Actions workflow.
Theoretically, we don't need aws_access_key_id and aws_secret_access_key. We need only aws_session_token to login into ECR because it has all needed for AWS information.
In practice:
aws_session_tokenas passwordSteps to reproduce this issue
docker/login-actioninpasswordparam, setregistryparam to be ecr url.Expected behaviour
Actual behaviour
Configuration