Error tagging ecr image with $$commit

Hello!

Having this weird error when trying to tag an image with the git commit:

Error parsing reference: “.dkr.ecr..amazonaws.com/*******:$COMMIT” is not a valid repository/tag: invalid reference format

my yaml:

steps:

  • name: build-publish
    image: plugins/ecr
    environment:
    DOCKER_LAUNCH_DEBUG: true
    AWS_ACCOUNT_ID:
    from_secret: aws_account_id
    AWS_REGION:
    from_secret: aws_region
    settings:
    access_key:
    from_secret: aws_access_key_id
    secret_key:
    from_secret: aws_secret_access_key
    repo: *****.amazonaws.com/reponame
    registry: ******.amazonaws.com
    file: Dockerfile
    tag: $$COMMIT

any idea why this is happening?

-tag: $$COMMIT
+tag: ${DRONE_COMMIT_SHA}

thanks a lot!!

any idea how to get the small commit hash though?

yes, you can use ${DRONE_COMMIT_SHA:0:8}

Thats it! Thanks a lot!!