From 46c8369cf831f0797b79b580c37c168a240710e5 Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 17:01:15 -0300 Subject: [PATCH 1/7] revert changes --- .github/workflows/iac.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index cba4374c..a0609106 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -138,17 +138,15 @@ jobs: - name: cleanup old checkout run: chmod +w -R ${GITHUB_WORKSPACE}; rm -rf ${GITHUB_WORKSPACE}/*; + - name: 'Checkout' + uses: actions/checkout@v4 + - name: Checkout actions uses: actions/checkout@v4 with: repository: signalwire/actions-template ref: main path: actions - - - name: 'Checkout' - uses: actions/checkout@v4 - with: - clean: false - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4.0.2 @@ -197,9 +195,6 @@ jobs: VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }} - uses: opentofu/setup-opentofu@main - # - run: | - # ls -la - # ${{ inputs.WORKING_DIR }} - name: Init id: init From 26a986427acb3fbcbb11f6199d92491febcaaa06 Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 17:25:50 -0300 Subject: [PATCH 2/7] add comment --- .github/workflows/iac.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index a0609106..95cb911a 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -248,9 +248,34 @@ jobs: OVH_APPLICATION_SECRET: ${{ secrets.OVH_APPLICATION_SECRET }} OVH_CONSUMER_KEY: ${{ secrets.OVH_CONSUMER_KEY }} OVH_CLOUD_PROJECT_SERVICE: ${{ secrets.OVH_CLOUD_PROJECT_SERVICE }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # TF_LOG: trace + - name: Comment PR + uses: actions/github-script@v6 + if: always() + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `### *${{ github.workflow }}* Action ([Run #${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})) Summary 🚀 + #### Target directory: ${{ inputs.WORKING_DIR }} + #### Terragrunt Format and Style 🖌️ ${{ steps.validate.outcome }} + #### Terraform Plan 📖 **${{ steps.plan.outcome }}** + +
Show Plan + + \`\`\`\n + ${{ steps.plan.outputs.tg_action_output }} + \`\`\` + +
+ + Pusher: *@${{ github.actor }}*, Action: *${{ github.event_name }}*` + }) + - name: Generate token id: generate_token uses: tibdex/github-app-token@v2 From 37e495ea2430ef6eafedd9ff3bb7f0eec37366e7 Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 17:28:37 -0300 Subject: [PATCH 3/7] debug comment --- .github/workflows/iac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index 95cb911a..2e88a3fb 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -248,7 +248,7 @@ jobs: OVH_APPLICATION_SECRET: ${{ secrets.OVH_APPLICATION_SECRET }} OVH_CONSUMER_KEY: ${{ secrets.OVH_CONSUMER_KEY }} OVH_CLOUD_PROJECT_SERVICE: ${{ secrets.OVH_CLOUD_PROJECT_SERVICE }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # TF_LOG: trace - name: Comment PR From 809d004029410d0961fe69b89ba9bd7a457facde Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 17:32:22 -0300 Subject: [PATCH 4/7] debug comment --- .github/workflows/iac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index 2e88a3fb..a1c8308a 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -248,7 +248,7 @@ jobs: OVH_APPLICATION_SECRET: ${{ secrets.OVH_APPLICATION_SECRET }} OVH_CONSUMER_KEY: ${{ secrets.OVH_CONSUMER_KEY }} OVH_CLOUD_PROJECT_SERVICE: ${{ secrets.OVH_CLOUD_PROJECT_SERVICE }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ github.token }} # TF_LOG: trace - name: Comment PR From 957f9b2dcfdab3af2a5905ceaded3964252196cf Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 17:46:36 -0300 Subject: [PATCH 5/7] debug comment --- .github/workflows/iac.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index a1c8308a..5a1a8ce6 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -126,8 +126,7 @@ jobs: name: ${{ inputs.ENVIRONMENT }} permissions: - contents: 'read' - id-token: 'write' + permissions: write-all steps: - name: Install dependencies From 51a05c5ac5c09a02046d56bfd0ce7051204c6af8 Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 17:47:35 -0300 Subject: [PATCH 6/7] debug comment --- .github/workflows/iac.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index 5a1a8ce6..452c0405 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -125,8 +125,7 @@ jobs: environment: name: ${{ inputs.ENVIRONMENT }} - permissions: - permissions: write-all + permissions: write-all steps: - name: Install dependencies From e5a733f36c35b1ceee87f67f19ff0aeaadcfba56 Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 17:53:03 -0300 Subject: [PATCH 7/7] fix comment + azure deploys --- .github/workflows/iac.yml | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index 452c0405..4710c905 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -249,31 +249,6 @@ jobs: GITHUB_TOKEN: ${{ github.token }} # TF_LOG: trace - - name: Comment PR - uses: actions/github-script@v6 - if: always() - with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `### *${{ github.workflow }}* Action ([Run #${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})) Summary 🚀 - #### Target directory: ${{ inputs.WORKING_DIR }} - #### Terragrunt Format and Style 🖌️ ${{ steps.validate.outcome }} - #### Terraform Plan 📖 **${{ steps.plan.outcome }}** - -
Show Plan - - \`\`\`\n - ${{ steps.plan.outputs.tg_action_output }} - \`\`\` - -
- - Pusher: *@${{ github.actor }}*, Action: *${{ github.event_name }}*` - }) - - name: Generate token id: generate_token uses: tibdex/github-app-token@v2