Forgot to update parameters #14
Workflow file for this run
This file contains 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 Development" | |
on: | |
push: | |
branches-ignore: | |
- 'main' | |
paths: | |
- 'terraform/**' | |
env: | |
name: dev | |
TF_CLOUD_ORGANIZATION: "${{ vars.TF_CLOUD_ORGANIZATION }}" | |
TF_API_TOKEN: "${{ secrets.TF_API_TOKEN }}" | |
TF_WORKSPACE: "${{ vars.TF_WORKSPACE }}" | |
defaults: | |
run: | |
working-directory: ./terraform | |
shell: bash | |
jobs: | |
terraform: | |
name: "Terraform Apply (Development)" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./terraform | |
shell: bash | |
permissions: | |
contents: read | |
pull-requests: write | |
environment: dev | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Terraform | |
id: tfc-setup | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} | |
- name: Terraform fmt | |
id: fmt | |
run: terraform fmt -check | |
continue-on-error: true | |
- name: Terraform Init | |
id: init | |
run: terraform init | |
- name: Terraform Validate | |
id: validate | |
run: terraform validate -no-color | |
- name: Terraform Apply | |
id: apply | |
run: terraform apply -no-color -input=false -auto-approve | |
continue-on-error: true | |
- name: truncate terraform apply result | |
run: | | |
apply=$(cat <<'EOF' | |
${{ format('{0}{1}', steps.apply.outputs.stdout, steps.apply.outputs.stderr) }} | |
EOF | |
) | |
echo "APPLY<<EOF" >> $GITHUB_ENV | |
echo "${apply:0:65536}" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Create commit comment | |
uses: peter-evans/commit-comment@v3 | |
id: cc | |
# env: | |
# APPLY: "terraform\n${{ steps.apply.outputs.stdout }}" | |
with: | |
body: | | |
#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\` | |
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\` | |
#### Terraform Validation 🤖\`${{ steps.validate.outcome }}\` | |
<details><summary>Validation Output</summary> | |
\`\`\`\n | |
${{ steps.validate.outputs.stdout }} | |
\`\`\` | |
</details> | |
#### Terraform Apply 📖\`${{ steps.apply.outcome }}\` | |
<details><summary>Show Apply</summary> | |
\`\`\`\n | |
${process.env.APPLY} | |
\`\`\` | |
</details> | |
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Working Directory: \`${{ env.tf_actions_working_dir }}\`, Workflow: \`${{ github.workflow }}\`*`; | |
- name: Check outputs | |
run: | | |
echo "Comment ID - ${{ steps.cc.outputs.comment-id }}" |