Skip to content
anchor

GitHub Action

crane-installer

v1.3 Latest version

crane-installer

anchor

crane-installer

GitHub Action for installing the crane CLI tool

Installation

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

              

- name: crane-installer

uses: IAreKyleW00t/crane-installer@v1.3

Learn more about this action in IAreKyleW00t/crane-installer

Choose a version

crane-installer GitHub Action

GitHub Marketplace GitHub tag (latest SemVer) GitHub Workflow Status License

This GitHub Action enables you to interacting with remote images and registries using crane. This action will verify the integrity of the crane release during installation if you setup SLSA 3 provenance (see notes and examples below).

For a quick start guide on the usage of crane, please refer to https://github.com/google/go-containerregistry/blob/main/cmd/crane/recipes.md. For available crane releases, see https://github.com/google/go-containerregistry/releases.


Tags

The following tags are available for the iarekylew00t/crane-installer action.

  • main
  • <version> (eg: v1.0.1, including: v1.0, v1, etc.)

Usage

This action currently supports GitHub-provided Linux, macOS and Windows runners (self-hosted runners may not work). MacOS and Windows runners do not work with the slsa-verifier action, so integrity validation is skipped for those.

Add the following entry to your Github workflow YAML file:

uses: iarekylew00t/crane-installer@v1
with:
  crane-release: v0.14.0 # optional

Inputs

input Description Default
crane-release crane release version to be installed latest
install-dir directory to install crane binary $HOME/.crane
username username to use for GitHub authentication ${{ github.actor }}
token token to use for GitHub authentication ${{ github.token }}

Examples

Pinned version

jobs:
  crane:
    runs-on: ubuntu-latest
    steps:
      - name: Install crane
        uses: iarekylew00t/crane-installer@v1
        with:
          crane-release: v0.14.0
      - name: Check install
        run: crane version

Default version

jobs:
  crane:
    runs-on: ubuntu-latest
    steps:
      - name: Install crane
        uses: iarekylew00t/crane-installer@v1
      - name: Check install
        run: crane version

Authenticate on other registries

jobs:
  crane:
    runs-on: ubuntu-latest
    steps:
      - uses: iarekylew00t/crane-installer@v1
      - name: Login to Docker Hub
        run: |
          echo "${{ secrets.DOCKERHUB_TOKEN }}" | \
          crane auth login docker.io \
            --username "${{ vars.DOCKERHUB_USERNAME }}" \
            --password-stdin

Automatic validation with SLSA

jobs:
  crane:
    runs-on: ubuntu-latest
    steps:
      - name: Install SLSA verifier
        uses: slsa-framework/slsa-verifier/actions/installer@v2.0.1
      - name: Install crane
        uses: iarekylew00t/crane-installer@v1
      - name: Check install
        run: crane version

Contributing

Feel free to contribute and make things better by opening an Issue or Pull Request.

License

See LICENSE.