Skip to content

Commit

Permalink
Merge pull request #2 from dawitnida/feature/add-yaml-instructions
Browse files Browse the repository at this point in the history
Add action.yml as GitHub instructed. Update HashiCorps packer docker …
  • Loading branch information
dawitnida authored Feb 19, 2020
2 parents e062c9f + e8002cc commit a64038e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM hashicorp/packer:1.3.5
FROM hashicorp/packer:1.5.4

LABEL "com.github.actions.name" = "Packer validate"
LABEL "com.github.actions.description" = "Validate packer template file in a directory"
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,28 @@ Check out the [packer validate command][packer-validate-doc] for further referen

## Usage

### YAML style

To configure the action simply add the following lines to your .github/workflows/packer-validate.yml workflow file:

```
name: Validate packer template file in a directory
on:
pull_request:
jobs:
packer_validate:
runs-on: hashicorp/packer:1.5.4
steps:
- name: Packer validate template-y without argument
uses: dawitnida/packer-github-actions/validate@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEMPLATE_FILE_NAME: ${{ env.TEMPLATE_FILE_NAME }}
```

### Legacy

To check this in action, please check [Packer actions demo project][packer-actions-demo] with a collection
of sample packer template files.

Expand Down Expand Up @@ -90,6 +112,11 @@ action "packer-validate-template-y" {
**Figure 3.** *Packer validate complete check list diagram*
![checks-list-diagram](assets/action-results.png)


## License

The Dockerfile and associated scripts and documentation in this project are released under the [Apache-2.0 License](LICENSE).

### Author
[Dawit Nida](https://github.com/dawitnida)

Expand Down
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: 'Packer validate'
author: 'Dawit Nida <dawit@dawitnida.com>'
description: 'Validate packer template file in a directory'
runs:
using: 'docker'
image: 'Dockerfile'
branding:
icon: 'check-circle'
color: 'blue'

0 comments on commit a64038e

Please sign in to comment.