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