feat(api): migrate wake API to OpenAPI spec #23
This file contains hidden or 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: Terraform CI | |
| on: | |
| pull_request: | |
| paths: | |
| - "infra/**" | |
| - ".github/workflows/terraform-ci.yml" | |
| - ".tflint.hcl" | |
| - ".checkov.yml" | |
| - ".tfsec.yml" | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| terraform-ci: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| terraform_version: | |
| - "1.6.6" | |
| - "1.8.5" | |
| - "1.9.5" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Terraform | |
| uses: hashicorp/setup-terraform@v3 | |
| with: | |
| terraform_version: ${{ matrix.terraform_version }} | |
| - name: Terraform fmt | |
| run: terraform fmt -check | |
| working-directory: infra | |
| - name: Terraform init (no backend) | |
| run: terraform init -backend=false | |
| working-directory: infra | |
| - name: Terraform validate | |
| run: terraform validate | |
| working-directory: infra | |
| - name: Setup TFLint | |
| uses: terraform-linters/setup-tflint@v4 | |
| with: | |
| tflint_version: latest | |
| - name: Run TFLint | |
| run: tflint --recursive | |
| working-directory: infra | |
| - name: Run tfsec | |
| uses: aquasecurity/tfsec-action@v1.0.3 | |
| with: | |
| working_directory: infra | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run Checkov | |
| uses: bridgecrewio/checkov-action@v12 | |
| with: | |
| directory: infra | |
| config_file: .checkov.yml | |
| quiet: true | |
| - name: Comment on PR with Terraform CI result | |
| if: always() | |
| uses: actions/github-script@v7 | |
| continue-on-error: true | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| try { | |
| const conclusion = '${{ job.status }}'; | |
| const symbols = { success: '✅', failure: '❌', cancelled: '⚪️' }; | |
| const symbol = symbols[conclusion] || 'ℹ️'; | |
| const body = | |
| `${symbol} Terraform CI finished with status: **${conclusion}**\n\n` + | |
| `Terraform versions tested: 1.6.6, 1.8.5, 1.9.5.\n` + | |
| `See detailed results in the "Checks" tab.`; | |
| const pr = context.payload.pull_request; | |
| if (!pr) { | |
| core.info('No pull_request context, skipping comment.'); | |
| return; | |
| } | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: pr.number, | |
| body | |
| }); | |
| } catch (error) { | |
| core.warning(`Failed to create Terraform CI PR comment: ${error.message}`); | |
| } |