Skip to content

eli-amazing/setup-packer

 
 

Repository files navigation

setup-packer

Test Hygiene CodeQL

Set up and cache the Packer CLI.

Roadmap

This action aims to provide an OS-neutral interface. And will not add features that only work on one operating system or manipulate the Packer CLI itself.

Usage

Currently, the semantic versioning style does not support to specify the version of the packer itself. ​If you want to use a version other than the latest one, be sure to specify the exact version.

Example workflow

name: Packer

on:
  - pull_request
  - push

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Use latest Packer
        uses: hashicorp-contrib/setup-packer@v2

      # or

      - name: Use latest Packer
        uses: hashicorp-contrib/setup-packer@v2
        with:
          packer-version: 1.6.5

      - name: Build image from template
        run: packer build TEMPLATE

​How to specify the version of the action itself

There is a point that is particularly easy to misunderstand. It's where you specify the version of the action itself.

- name: Use latest Packer
  uses: hashicorp-contrib/setup-packer@v2
  #                                   ^^^

We recommend that you include the version of the action. We adhere to semantic versioning, it's safe to use the major version (v2) in your workflow. If you use the master branch, this could break your workflow when we publish a breaking update and increase the major version.

steps:
  # Reference the major version of a release (most recommended)
  - uses: hashicorp-contrib/setup-packer@v2
  # Reference a specific commit (most strict)
  - uses: hashicorp-contrib/setup-packer@ee5bed6
  # Reference a semver version of a release (not recommended)
  - uses: hashicorp-contrib/setup-packer@v2.0.0
  # Reference a branch (most dangerous)
  - uses: hashicorp-contrib/setup-packer@master

Inputs

  • github-token: The API token for the action to get the latest release of Packer from GitHub API (default ${{ github.token }})
  • packer-version: The version to use (default latest)

About

GitHub Action for the Packer CLI

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%