|
10 | 10 | workflow_dispatch: |
11 | 11 |
|
12 | 12 | jobs: |
13 | | - pre-commit: |
14 | | - runs-on: ubuntu-latest |
15 | | - steps: |
16 | | - - uses: actions/checkout@v4 |
17 | | - - uses: actions/setup-python@v5 |
18 | | - - uses: terraform-linters/setup-tflint@v4 |
19 | | - - uses: pre-commit/action@v3.0.1 |
20 | | - with: |
21 | | - extra_args: "-a" |
22 | | - |
23 | 13 | validate: |
24 | | - name: Validate |
25 | | - needs: [pre-commit] |
26 | | - runs-on: ubuntu-latest |
27 | | - permissions: |
28 | | - contents: read |
29 | | - pull-requests: write |
30 | | - statuses: read |
31 | | - strategy: |
32 | | - fail-fast: true |
33 | | - matrix: |
34 | | - tf-version: ["1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "latest"] |
35 | | - steps: |
36 | | - - name: Checkout code |
37 | | - uses: actions/checkout@v4 |
38 | | - - name: Setup Terraform |
39 | | - uses: hashicorp/setup-terraform@v3 |
40 | | - with: |
41 | | - terraform_version: ${{ matrix.tf-version }} |
42 | | - - name: Terraform Init |
43 | | - run: | |
44 | | - terraform init -backend=false -upgrade -reconfigure |
45 | | - - name: Terraform FMT |
46 | | - run: | |
47 | | - terraform fmt -check -recursive |
48 | | - - name: Terraform Validate |
49 | | - run: | |
50 | | - terraform validate |
51 | | - - name: Terraform Version / Providers |
52 | | - run: | |
53 | | - terraform version |
54 | | - terraform providers |
55 | | - - name: Examples Complete Validate |
56 | | - run: | |
57 | | - cd examples/complete |
58 | | - terraform init -backend=false -upgrade -reconfigure |
59 | | - terraform validate |
60 | | - - name: Exmaple Remote Validate |
61 | | - run: | |
62 | | - cd examples/remote |
63 | | - terraform init -backend=false -upgrade -reconfigure |
64 | | - terraform validate |
| 14 | + uses: saidsef/saidsef/.github/workflows/tf-validate.yaml@main |
| 15 | + with: |
| 16 | + start-version: '0' |
| 17 | + end-version: '8' |
65 | 18 |
|
66 | 19 | tfsec: |
67 | | - name: tfsec |
68 | | - runs-on: ubuntu-latest |
69 | | - permissions: |
70 | | - contents: read |
71 | | - pull-requests: write |
| 20 | + uses: saidsef/saidsef/.github/workflows/tf-security.yaml@main |
72 | 21 | needs: [validate] |
73 | | - steps: |
74 | | - - name: Checkout code |
75 | | - uses: actions/checkout@v4 |
76 | | - - name: tfsec |
77 | | - uses: aquasecurity/tfsec-action@v1.0.3 |
78 | | - with: |
79 | | - additional_args: "--force-all-dirs --concise-output --code-theme=dark" |
80 | | - version: "latest" |
81 | | - github_token: ${{ github.token }} |
| 22 | + |
| 23 | + attest: |
| 24 | + uses: saidsef/saidsef/.github/workflows/tf-attest.yaml@main |
| 25 | + needs: [tfsec] |
82 | 26 |
|
83 | 27 | caller-identity-check: |
84 | 28 | if: contains(github.event_name, 'pull_request') |
@@ -107,20 +51,5 @@ jobs: |
107 | 51 | gcloud info |
108 | 52 |
|
109 | 53 | auto-approve: |
110 | | - if: contains(github.event_name, 'pull_request') |
111 | | - runs-on: ubuntu-latest |
112 | | - permissions: |
113 | | - pull-requests: write |
| 54 | + uses: saidsef/saidsef/.github/workflows/auto-approve.yaml@main |
114 | 55 | needs: [validate, tfsec, caller-identity-check] |
115 | | - steps: |
116 | | - - name: Auto Approve PR |
117 | | - uses: actions/github-script@v7 |
118 | | - with: |
119 | | - github-token: ${{ github.token }} |
120 | | - script: | |
121 | | - github.rest.pulls.createReview({ |
122 | | - owner: context.repo.owner, |
123 | | - repo: context.repo.repo, |
124 | | - pull_number: context.issue.number, |
125 | | - event: "APPROVE" |
126 | | - }) |
0 commit comments