diff --git a/Dockerfile b/Dockerfile index f77036a..7f030c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" diff --git a/README.md b/README.md index 055f4e2..e7203a8 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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) diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..3fe2f66 --- /dev/null +++ b/action.yml @@ -0,0 +1,9 @@ +name: 'Packer validate' +author: 'Dawit Nida ' +description: 'Validate packer template file in a directory' +runs: + using: 'docker' + image: 'Dockerfile' +branding: + icon: 'check-circle' + color: 'blue' \ No newline at end of file