diff --git a/.github/workflows/aws-cfn-lint.yml b/.github/workflows/aws-cfn-lint.yml new file mode 100644 index 000000000..11ed43317 --- /dev/null +++ b/.github/workflows/aws-cfn-lint.yml @@ -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/ \ No newline at end of file