Skip to content

int128/find-ecr-repository-action

Repository files navigation

find-ecr-repository-action ts

This action finds an Amazon ECR repository.

Getting Started

Here is an example workflow to build and push a container image to Amazon ECR.

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: aws-actions/configure-aws-credentials@v4
        with:
          aws-region: us-east-1
          role-to-assume: arn:aws:iam::123456789012:role/YourRoleName
      - id: ecr-repository
        uses: int128/find-ecr-repository-action@v1
        with:
          repository-name: hello-world
      - id: metadata
        uses: docker/metadata-action@v5
        with:
          images: ${{ steps.ecr-repository.outputs.repository-uri }}
      - uses: docker/build-push-action@v6
        id: build
        with:
          tags: ${{ steps.metadata.outputs.tags }}

You can set a custom error message if the repository is not found.

- uses: int128/find-ecr-repository-action@v1
  with:
    repository-name: hello-world
    repository-not-found-error-message: |
      Repository {{repository-name}} not found in Amazon ECR.
      You need to create it by Terraform.

Specification

Inputs

Name Default Description
registry-id - AWS account ID of the repository. If not set, the default account will be used.
repository-name (required) Name of the repository in Amazon ECR
repository-not-found-error-message action.yaml Error message to throw if the repository is not found

Outputs

Name Description
repository-uri URI of the repository in Amazon ECR

About

Action to find repository in Amazon ECR

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Generated from int128/typescript-action