{"id":14970072,"url":"https://github.com/hashicorp/setup-packer","last_synced_at":"2025-05-16T09:04:46.371Z","repository":{"id":40657692,"uuid":"249712273","full_name":"hashicorp/setup-packer","owner":"hashicorp","description":"Run HashiCorp Packer as part of your GitHub Actions Workflow","archived":false,"fork":false,"pushed_at":"2025-05-01T06:02:32.000Z","size":1389,"stargazers_count":148,"open_issues_count":16,"forks_count":84,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-08T09:42:11.045Z","etag":null,"topics":["github-actions","hashicorp","packer"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/setup-hashicorp-packer","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hashicorp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-03-24T13:14:41.000Z","updated_at":"2025-05-02T13:25:47.000Z","dependencies_parsed_at":"2023-02-17T17:40:16.619Z","dependency_job_id":"91e43762-e175-4788-9df3-b2b1216274ce","html_url":"https://github.com/hashicorp/setup-packer","commit_stats":{"total_commits":59,"total_committers":19,"mean_commits":"3.1052631578947367","dds":0.711864406779661,"last_synced_commit":"76e3039aa951aa4e6efe7e6ee06bc9ceb072142d"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fsetup-packer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fsetup-packer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fsetup-packer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fsetup-packer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashicorp","download_url":"https://codeload.github.com/hashicorp/setup-packer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254501557,"owners_count":22081528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","hashicorp","packer"],"created_at":"2024-09-24T13:42:59.632Z","updated_at":"2025-05-16T09:04:41.361Z","avatar_url":"https://github.com/hashicorp.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Action: `setup-packer`\n\nThe `hashicorp/setup-packer` Action sets up the [Packer](https://www.packer.io) CLI in your GitHub Actions workflow by adding the `packer` binary to `PATH`.\n\n[![GitHub Action: Self-Test](https://github.com/hashicorp/setup-packer/actions/workflows/actions-self-test.yml/badge.svg?branch=main)](https://github.com/hashicorp/setup-packer/actions/workflows/actions-self-test.yml)\n\n## Table of Contents\n\n\u003c!-- TOC --\u003e\n* [GitHub Action: `setup-packer`](#github-action-setup-packer)\n  * [Table of Contents](#table-of-contents)\n  * [Requirements](#requirements)\n  * [Usage](#usage)\n  * [Inputs](#inputs)\n  * [Outputs](#outputs)\n  * [Integrating with HCP Packer](#integrating-with-hcp-packer)\n  * [Author Information](#author-information)\n  * [License](#license)\n\u003c!-- TOC --\u003e\n\n## Requirements\n\nThis GitHub Actions supports all commands that are available in the `packer` CLI.\n\nThe [`build`](https://developer.hashicorp.com/packer/docs/commands/build) command may require access to provider-specific credentials.\n\nOther [environment variables](https://developer.hashicorp.com/packer/docs/commands#environment-variables) (such as `PACKER_LOG`) may be set as normal and will be picked up accordingly.\n\n## Usage\n\nCreate a GitHub Actions Workflow file (e.g.: `.github/workflows/packer.yml`):\n\n```yaml\nname: packer\n\non:\n  push:\n\nenv:\n  PRODUCT_VERSION: \"1.10.0\" # or: \"latest\"\n\njobs:\n  packer:\n    runs-on: ubuntu-latest\n    name: Run Packer\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n\n      - name: Setup `packer`\n        uses: hashicorp/setup-packer@main\n        id: setup\n        with:\n          version: ${{ env.PRODUCT_VERSION }}\n\n      - name: Run `packer init`\n        id: init\n        run: \"packer init ./image.pkr.hcl\"\n\n      - name: Run `packer validate`\n        id: validate\n        run: \"packer validate ./image.pkr.hcl\"\n```\n\nIn the above example, the following definitions have been set.\n\n- The event trigger has been set to `push`. For a complete list, see [Events that trigger workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows).\n- The origin of this GitHub Action has been set as `hashicorp/setup-packer@main`. For newer versions, see the [Releases](https://github.com/hashicorp/setup-packer/releases).\n- The version of `packer` to set up has been set as `1.10.0`. For a complete list, see [releases.hashicorp.com](https://releases.hashicorp.com/packer/).\n- The Packer manifest to interact with has been set as `./image.pkr.hcl`.\n\nThese definitions may require updating to suit your deployment, such as specifying [self-hosted](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-self-hosted-runners) runners.\n\nAdditionally, you may configure [outputs](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-defining-outputs-for-a-job) to consume return values from the Action's operations.\n\n## Inputs\n\nThis section contains a list of all inputs that may be set for this Action.\n\n- `version` - The version of `packer` to install. Defaults to `latest` if unset.\n\n\u003e [!NOTE]\n\u003e To retrieve the `latest` version, this GitHub Action polls the HashiCorp [Releases API](https://api.releases.hashicorp.com/v1/releases/packer) and finds the latest released version of Packer that isn't marked as a pre-release (`is_prerelease`).\n\n## Outputs\n\nThis section contains a list of all outputs that can be consumed from this Action.\n\n- `version` -  The version of `packer` that was installed.\n\n## Integrating with HCP Packer\n\nTo integrate with HCP Packer, add your HCP Client ID and HCP Client secret as environment variables to the Packer build call.\n\nWe add an `HCP_PACKER_BUILD_FINGERPRINT` in this example that is based on the workflow run ID, that way it is always unique\n\nWe recommend storing these in [GitHub Actions Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) (as opposed to plain-text).\n\nFor more information on using HCP Packer, see the [Getting Started tutorial](https://developer.hashicorp.com/packer/tutorials/hcp-get-started/hcp-push-image-metadata).\n\n```yaml\nname: hcp-packer\n\non:\n  - push\n\njobs:\n  hcp-packer:\n    runs-on: ubuntu-latest\n    name: Run Packer\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n\n      - name: Setup `packer`\n        uses: hashicorp/setup-packer@main\n        id: setup\n        with:\n          version: \"latest\"\n\n      - name: Run `packer init`\n        id: init\n        run: \"packer init ./image.pkr.hcl\"\n\n      - name: Run `packer validate`\n        id: validate\n        run: \"packer validate ./image.pkr.hcl\"\n\n      - name: Build Artifact\n        run: packer build -color=false -on-error=abort ./image.pkr.hcl\n        env:\n          HCP_CLIENT_ID: ${{ secrets.HCP_CLIENT_ID }}\n          HCP_CLIENT_SECRET: ${{ secrets.HCP_CLIENT_SECRET }}\n          HCP_PACKER_BUILD_FINGERPRINT: \"run.id.${{ github.run_id }}.run.attempt.${{ github.run_attempt }}\"\n```\n\n## Author Information\n\nThis GitHub Action is maintained by the contributors listed on [GitHub](https://github.com/hashicorp/setup-packer/graphs/contributors).\n\nThe original code of this repository is based on work done by [Matthew Sanabria](https://github.com/sudomateo) as part of the [setup-packer](https://github.com/sudomateo/setup-packer) GitHub Action.\n\n## License\n\nLicensed under the Apache License, Version 2.0 (the \"License\").\n\nYou may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0).\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an _\"AS IS\"_ basis, without WARRANTIES or conditions of any kind, either express or implied.\n\nSee the License for the specific language governing permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fsetup-packer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashicorp%2Fsetup-packer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fsetup-packer/lists"}