From 7605db55189fb6b5bc46eb4c2badd80b90df9372 Mon Sep 17 00:00:00 2001 From: delager Date: Thu, 6 Apr 2023 11:22:33 +0200 Subject: [PATCH 1/3] #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 --- .github/workflows/aws-cfn-lint.yml | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/aws-cfn-lint.yml diff --git a/.github/workflows/aws-cfn-lint.yml b/.github/workflows/aws-cfn-lint.yml new file mode 100644 index 000000000..f554e50f6 --- /dev/null +++ b/.github/workflows/aws-cfn-lint.yml @@ -0,0 +1,47 @@ +name: Validate CloudFormation templates + +on: + pull_request: + branches: [ main-vnext ] + paths: + - 'templates/aws/**' + push: + branches: [ main-vnext ] + paths: + - 'templates/aws/**' + schedule: + # ┌───────────── minute (0 - 59) + # │ ┌───────────── hour (0 - 23) + # │ │ ┌───────────── day of the month (1 - 31) + # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) + # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) + # │ │ │ │ │ + # │ │ │ │ │ + # │ │ │ │ │ + # * * * * * + - cron: '30 1 * * *' + 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 From b7cd605b125c8a882662d394cfbdfb711e039b33 Mon Sep 17 00:00:00 2001 From: delager Date: Tue, 11 Apr 2023 10:13:16 +0200 Subject: [PATCH 2/3] #1942 Remove schedule No schedule needed for this workflow --- .github/workflows/aws-cfn-lint.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/aws-cfn-lint.yml b/.github/workflows/aws-cfn-lint.yml index f554e50f6..c6e062b90 100644 --- a/.github/workflows/aws-cfn-lint.yml +++ b/.github/workflows/aws-cfn-lint.yml @@ -9,17 +9,6 @@ on: branches: [ main-vnext ] paths: - 'templates/aws/**' - schedule: - # ┌───────────── minute (0 - 59) - # │ ┌───────────── hour (0 - 23) - # │ │ ┌───────────── day of the month (1 - 31) - # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) - # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) - # │ │ │ │ │ - # │ │ │ │ │ - # │ │ │ │ │ - # * * * * * - - cron: '30 1 * * *' workflow_dispatch: jobs: From 0e628c3b27530bf97a4f4b2bcf36135997240d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?DELAGE=20Rapha=C3=ABl?= <36408929+delager@users.noreply.github.com> Date: Tue, 11 Apr 2023 11:45:37 +0200 Subject: [PATCH 3/3] #1942 Add main branche Co-authored-by: Kevin BEAUGRAND <9513635+kbeaugrand@users.noreply.github.com> --- .github/workflows/aws-cfn-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/aws-cfn-lint.yml b/.github/workflows/aws-cfn-lint.yml index c6e062b90..11ed43317 100644 --- a/.github/workflows/aws-cfn-lint.yml +++ b/.github/workflows/aws-cfn-lint.yml @@ -2,11 +2,11 @@ name: Validate CloudFormation templates on: pull_request: - branches: [ main-vnext ] + branches: [ main, main-vnext ] paths: - 'templates/aws/**' push: - branches: [ main-vnext ] + branches: [ main, main-vnext ] paths: - 'templates/aws/**' workflow_dispatch: