|  | 
|  | 1 | +--- | 
|  | 2 | +name: pull request | 
|  | 3 | +on: | 
|  | 4 | +  pull_request: | 
|  | 5 | + | 
|  | 6 | +jobs: | 
|  | 7 | +  pre-commit: | 
|  | 8 | +    runs-on: ubuntu-latest | 
|  | 9 | +    steps: | 
|  | 10 | +      - uses: actions/checkout@v2 | 
|  | 11 | +      - name: Set up Python | 
|  | 12 | +        uses: actions/setup-python@v2 | 
|  | 13 | +      - name: Install prerequisites | 
|  | 14 | +        run: ./bin/install-ubuntu.sh | 
|  | 15 | +      - name: Setup Terraform | 
|  | 16 | +        uses: hashicorp/setup-terraform@v1 | 
|  | 17 | +        with: | 
|  | 18 | +          terraform_version: ~> 0.12.29 | 
|  | 19 | +      - name: initialize Terraform | 
|  | 20 | +        run: terraform init --backend=false | 
|  | 21 | +      - name: pre-commit | 
|  | 22 | +        uses: pre-commit/[email protected] | 
|  | 23 | +        env: | 
|  | 24 | +          AWS_DEFAULT_REGION: us-east-1 | 
|  | 25 | +          # many of these are covered by better reviewdog linters below | 
|  | 26 | +          SKIP: >- | 
|  | 27 | +            terraform_tflint_deep, | 
|  | 28 | +            no-commit-to-branch, | 
|  | 29 | +            terraform_tflint_nocreds, | 
|  | 30 | +            terraform_tfsec | 
|  | 31 | +      - uses: stefanzweifel/git-auto-commit-action@v4 | 
|  | 32 | +        if: ${{ failure() }} | 
|  | 33 | +        with: | 
|  | 34 | +          commit_message: Apply automatic changes | 
|  | 35 | +          commit_options: "--no-verify" | 
|  | 36 | +          # Optional commit user and author settings | 
|  | 37 | +          commit_user_name: Linter Bot | 
|  | 38 | +          commit_user_email: [email protected] | 
|  | 39 | +          commit_author: Linter Bot <[email protected]> | 
|  | 40 | +  tflint: | 
|  | 41 | +    runs-on: ubuntu-latest | 
|  | 42 | +    steps: | 
|  | 43 | +      - uses: actions/checkout@v2 | 
|  | 44 | +      - name: setup Terraform | 
|  | 45 | +        uses: hashicorp/setup-terraform@v1 | 
|  | 46 | +        with: | 
|  | 47 | +          terraform_version: 0.12.26 | 
|  | 48 | +      - name: Terraform init | 
|  | 49 | +        run: terraform init --backend=false | 
|  | 50 | +      - name: tflint | 
|  | 51 | +        uses: reviewdog/action-tflint@master | 
|  | 52 | +        with: | 
|  | 53 | +          github_token: ${{ secrets.GITHUB_TOKEN }} | 
|  | 54 | +          reporter: github-pr-check | 
|  | 55 | +          filter_mode: added | 
|  | 56 | +          flags: --module | 
|  | 57 | +          level: error | 
|  | 58 | +  tfsec: | 
|  | 59 | +    runs-on: ubuntu-latest | 
|  | 60 | +    steps: | 
|  | 61 | +      - uses: actions/checkout@v2 | 
|  | 62 | +      - name: setup Terraform | 
|  | 63 | +        uses: hashicorp/setup-terraform@v1 | 
|  | 64 | +        with: | 
|  | 65 | +          terraform_version: 0.12.26 | 
|  | 66 | +      - name: Terraform init | 
|  | 67 | +        run: terraform init --backend=false | 
|  | 68 | +      - name: tfsec | 
|  | 69 | +        uses: reviewdog/action-tfsec@master | 
|  | 70 | +        with: | 
|  | 71 | +          github_token: ${{ secrets.GITHUB_TOKEN }} | 
|  | 72 | +          reporter: github-pr-check | 
|  | 73 | +          filter_mode: added | 
|  | 74 | +          level: warning | 
|  | 75 | +  misspell: | 
|  | 76 | +    runs-on: ubuntu-latest | 
|  | 77 | +    steps: | 
|  | 78 | +      - uses: actions/checkout@v2 | 
|  | 79 | +      - name: misspell | 
|  | 80 | +        uses: reviewdog/action-misspell@v1 | 
|  | 81 | +        with: | 
|  | 82 | +          github_token: ${{ secrets.GITHUB_TOKEN }} | 
|  | 83 | +          locale: "US" | 
|  | 84 | +          reporter: github-pr-check | 
|  | 85 | +          filter_mode: added | 
|  | 86 | +          level: error | 
|  | 87 | +  yamllint: | 
|  | 88 | +    runs-on: ubuntu-latest | 
|  | 89 | +    steps: | 
|  | 90 | +      - uses: actions/checkout@v2 | 
|  | 91 | +      - name: yamllint | 
|  | 92 | +        uses: reviewdog/action-yamllint@v1 | 
|  | 93 | +        with: | 
|  | 94 | +          github_token: ${{ secrets.GITHUB_TOKEN }} | 
|  | 95 | +          reporter: github-pr-check | 
|  | 96 | +          filter_mode: added | 
|  | 97 | +          level: error | 
0 commit comments