Update Config Rules #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Config Rules | |
on: | |
schedule: | |
- cron: '0 0 1,15 * *' | |
workflow_dispatch: | |
jobs: | |
update-rules: | |
name: Update Rules | |
runs-on: ubuntu-latest | |
outputs: | |
any_changed: ${{ steps.changed-files.outputs.any_changed }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Update rules | |
id: update-rules | |
run: | | |
cd scripts | |
pip install -r requirements.txt | |
python index.py | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v44 | |
with: | |
files: | | |
managed_rules_locals.tf | |
managed_rules_variables.tf | |
- name: List all changed files | |
run: echo '${{ steps.changed-files.outputs.all_changed_files }}' | |
- uses: actions/cache@v4 | |
name: Cache plugin dir | |
with: | |
path: ~/.tflint.d/plugins | |
key: tflint-${{ hashFiles('.tflint.hcl') }} | |
- uses: terraform-linters/setup-tflint@v4 | |
name: Setup TFLint | |
with: | |
tflint_version: v0.50.3 | |
- name: Show version | |
run: tflint --version | |
- name: Init TFLint | |
run: tflint --init | |
- name: Run TFLint | |
run: tflint --disable-rule=terraform_required_version | |
- uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: 1.6.0 | |
- name: Terraform Format | |
run: terraform fmt --recursive . | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
if: ${{ steps.changed-files.outputs.any_changed == 'true' }} | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
base: main | |
branch: auto-update-aws-config-rules | |
add-paths: | | |
managed_rules_locals.tf | |
managed_rules_variables.tf | |
commit-message: Automatic updates to AWS managed Config Rules | |
delete-branch: true | |
title: '[Auto] Update AWS Config Rules' | |
body: | | |
Update the list of AWS managed Config Rules using the [latest documentation](https://docs.aws.amazon.com/config/latest/developerguide/managed-rules-by-aws-config.html). | |
assignees: bensonce | |
reviewers: bensonce,duraikkannuv2 |