Skip to content

IAreKyleW00t/crane-installer

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.