Skip to content

Commit

Permalink
Fix GITHUB multiline output
Browse files Browse the repository at this point in the history
Also, tables are nice
  • Loading branch information
hellais committed Feb 2, 2024
1 parent 2f00a4f commit 5b6ae86
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions .github/workflows/deploy_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ on:
- tf-actions
#paths:
# - 'tf/environments/production/**'
env:
tf_actions_working_dir: "./tf/environments/production"

jobs:
terraform:
runs-on: ubuntu-latest
defaults:
run:
working-directory: "./tf/environments/production"
working-directory: ${{ env.tf_actions_working_dir }}

permissions:
pull-requests: write
env:
Expand All @@ -38,11 +41,18 @@ jobs:

- name: Terraform Validate
id: validate
run: echo "terraform_validate=$(terraform validate -no-color)" >> "$GITHUB_OUTPUT"
run: |
echo "terraform_validate<<EOF" >> "$GITHUB_OUTPUT"
terraform validate -no-color >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- name: Terraform Plan
id: plan
run: echo "terraform_plan=$(terraform plan -no-color)" >> "$GITHUB_OUTPUT"
run: |
echo "terraform_plan=<<EOF" >> "$GITHUB_OUTPUT"
terraform plan -no-color >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
continue-on-error: true

- uses: actions/github-script@v6
Expand Down Expand Up @@ -71,10 +81,13 @@ jobs:
</details>
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`,
Working Directory: \`${{ env.tf_actions_working_dir }}\`, Workflow: \`${{ github.workflow }}\`*
Last updated: ${(new Date()).toUTCString()};
| | |
|-------------------|-----------------------------------|
| Pusher | @${{ github.actor }} |
| Action | ${{ github.event_name }} |
| Working Directory | ${{ env.tf_actions_working_dir }} |
| Workflow | ${{ github.workflow }} |
| Last updated | ${(new Date()).toUTCString()} |
`;
const prNumber = context.payload.pull_request.number
Expand Down

0 comments on commit 5b6ae86

Please sign in to comment.