From 5b6ae869d5fc3be88d1cc78425d0b88ace87f539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arturo=20Filast=C3=B2?= Date: Fri, 2 Feb 2024 23:14:09 +0100 Subject: [PATCH] Fix GITHUB multiline output Also, tables are nice --- .github/workflows/deploy_production.yml | 27 ++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy_production.yml b/.github/workflows/deploy_production.yml index 4f1b9252..0ea677ea 100644 --- a/.github/workflows/deploy_production.yml +++ b/.github/workflows/deploy_production.yml @@ -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: @@ -38,11 +41,18 @@ jobs: - name: Terraform Validate id: validate - run: echo "terraform_validate=$(terraform validate -no-color)" >> "$GITHUB_OUTPUT" + run: | + echo "terraform_validate<> "$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=<> "$GITHUB_OUTPUT" + terraform plan -no-color >> "$GITHUB_OUTPUT" + echo "EOF" >> "$GITHUB_OUTPUT" + continue-on-error: true - uses: actions/github-script@v6 @@ -71,10 +81,13 @@ jobs: - *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