Skip to content

ci(terraform): Bump hashicorp/hcp from 0.77.0 to 0.79.0 in /terraform-cloud #37

ci(terraform): Bump hashicorp/hcp from 0.77.0 to 0.79.0 in /terraform-cloud

ci(terraform): Bump hashicorp/hcp from 0.77.0 to 0.79.0 in /terraform-cloud #37

name: Tfcmt
on:
push:
branches: [main]
paths: ["**.tf", "**.tfvars", "**/.terraform.lock.hcl"]
pull_request:
types: [opened, reopened, synchronize]
paths: ["**.tf", "**.tfvars", "**/.terraform.lock.hcl"]
jobs:
opentofu-tfcmt:
name: ${{ format('{0} ({1})', github.event_name == 'push' && 'Apply' || 'Plan', matrix.workspace) }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
workspace: ["github", "terraform-cloud"]
steps:
- uses: actions/checkout@v4
- uses: actions/create-github-app-token@v1
id: create-github-app-token
with:
app-id: ${{ secrets.ACTIONS_PYTHON_CI_APP_ID }}
private-key: ${{ secrets.ACTIONS_PYTHON_CI_APP_PEM_FILE }}
- uses: opentofu/setup-opentofu@v1
with:
cli_config_credentials_token: ${{ secrets.APP_TERRAFORM_IO_TOKEN }}
tofu_version: 1.6.0-alpha5
tofu_wrapper: "false"
- uses: shmokmt/actions-setup-tfcmt@v2
with:
version: v4.7.1
- name: Init
run: tofu init
working-directory: ${{ matrix.workspace }}
- name: Plan
if: ${{ github.event_name == 'pull_request' }}
run: |
tfcmt -var "target:${{ matrix.workspace }}" plan -patch -- tofu plan -no-color
env:
GITHUB_TOKEN: ${{ steps.create-github-app-token.outputs.token }}
working-directory: ${{ matrix.workspace }}
- name: Apply
if: ${{ github.event_name == 'push' }}
run: |
tfcmt -var "target:${{ matrix.workspace }}" apply -- tofu apply -auto-approve
env:
GITHUB_TOKEN: ${{ steps.create-github-app-token.outputs.token }}
working-directory: ${{ matrix.workspace }}