Bump actions/checkout from 4 to 5 #11
Workflow file for this run
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: Plan | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| static: | |
| name: Plan | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Terraform Setup | |
| uses: hashicorp/setup-terraform@v3 | |
| - name: Restore Terraform Cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| .terraform | |
| .terraform.lock.hcl | |
| key: terraform | |
| - name: Terraform Init | |
| env: | |
| TF_TOKEN_app_terraform_io: ${{ secrets.TF_TOKEN_app_terraform_io }} | |
| run: terraform init -input=false | |
| - name: Save Terraform Cache | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| .terraform | |
| .terraform.lock.hcl | |
| key: terraform | |
| - name: Restore Defaults Cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: defaults.yaml | |
| key: defaults | |
| - name: Terraform Plan | |
| id: plan | |
| env: | |
| TF_TOKEN_app_terraform_io: ${{ secrets.TF_TOKEN_app_terraform_io }} | |
| ACI_URL: ${{ secrets.ACI_URL }} | |
| ACI_USERNAME: ${{ secrets.ACI_USERNAME }} | |
| ACI_PASSWORD: ${{ secrets.ACI_PASSWORD }} | |
| run: terraform plan -input=false -no-color | |
| - name: Add Pull Request Comment | |
| uses: actions/github-script@v7 | |
| env: | |
| PLAN: "terraform\n${{ steps.plan.outputs.stdout }}" | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const output = `#### Terraform Plan\`${{ steps.plan.outcome }}\` | |
| <details><summary>Show Plan</summary> | |
| \`\`\`\n | |
| ${process.env.PLAN} | |
| \`\`\` | |
| </details> | |
| *Pusher: @${{ github.actor }}*`; | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: output | |
| }) |