Skip to content

Commit

Permalink
1942 - Add Cloud Formation Linter check in CI (#2002)
Browse files Browse the repository at this point in the history
* #1942 Add CI for CloudFormation scripts

- Add new CI for AWS CloudFormation scripts
- Add label 'cfn-templates' on PR
- Add syntax checking of cfn scripts using scottbrenner/cfn-lint-action

* #1942 Remove schedule

No schedule needed for this workflow

* #1942 Add main branche

Co-authored-by: Kevin BEAUGRAND <9513635+kbeaugrand@users.noreply.github.com>

---------

Co-authored-by: Kevin BEAUGRAND <9513635+kbeaugrand@users.noreply.github.com>
  • Loading branch information
delager and kbeaugrand committed Jun 23, 2023
1 parent fa4ffdf commit 78513b3
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/aws-cfn-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Validate CloudFormation templates

on:
pull_request:
branches: [ main, main-vnext ]
paths:
- 'templates/aws/**'
push:
branches: [ main, main-vnext ]
paths:
- 'templates/aws/**'
workflow_dispatch:

jobs:
validate_cfn_templates:
name: Build and Validate CloudFormation Templates
runs-on: ubuntu-latest

steps:
- name: Apply cfn-templates label on PR
uses: actions/github-script@v6
if: ${{ github.event_name == 'pull_request' }}
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['cfn-templates']
})
- uses: actions/checkout@v3.4.0

- name: Check CloudFormation Syntax
uses: scottbrenner/cfn-lint-action@v2
with:
path: templates/aws/

0 comments on commit 78513b3

Please sign in to comment.