From 485fc73b092eb2ba345c2aa9c4c347e720581d1c Mon Sep 17 00:00:00 2001 From: Benjamin Chiverton Date: Wed, 26 Jun 2024 17:38:40 +0100 Subject: [PATCH] Update instance-deploy-test.yml --- .github/workflows/instance-deploy-test.yml | 41 +++++++++++++--------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/.github/workflows/instance-deploy-test.yml b/.github/workflows/instance-deploy-test.yml index bc91c37..b8d8149 100644 --- a/.github/workflows/instance-deploy-test.yml +++ b/.github/workflows/instance-deploy-test.yml @@ -120,7 +120,7 @@ jobs: location: 'East US' resourceGroup: ${{ env.resource_group_name }} targetPort: 8080 - environmentVariables: "OTEL_EXPORTER_OTLP_ENDPOINT=https://${{ env.container_app_monitoring_fqdn }}:18889" + environmentVariables: "OTEL_EXPORTER_OTLP_ENDPOINT=https://onlinestore-monitoring:18889" - name: Deploy website uses: azure/container-apps-deploy-action@v1 with: @@ -133,24 +133,31 @@ jobs: resourceGroup: ${{ env.resource_group_name }} targetPort: 80 environmentVariables: "API__BASEPATH=https://${{ env.container_app_api_fqdn }}" - - name: Post test environment information on PR - uses: actions/github-script@0.9.0 - if: github.event_name == 'pull_request' - env: - PLAN: "terraform\n${{ steps.plan.outputs.stdout }}" + - name: Find Comment + uses: peter-evans/find-comment@v1 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: | + ### Test environment information + - name: Create comment + if: steps.fc.outputs.comment-id == '' + uses: peter-evans/create-or-update-comment@v1 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const output = `### Test environment information + issue-number: ${{ github.event.pull_request.number }} + body: | + ### Test environment information + reactions: rocket + - name: Update comment + if: steps.fc.outputs.comment-id != '' + uses: peter-evans/create-or-update-comment@v1 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + body: | + ### Test environment information #### 🔗[Visit website](https://${{ env.container_app_website_fqdn }}/) #### 🔗[Visit API](https://${{ env.container_app_api_fqdn }}/swagger/) #### 🔗[Visit monitoring UI](https://${{ env.container_app_monitoring_fqdn }}) - *Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Working Directory: \`${{ env.tf_actions_working_dir }}\`, Workflow: \`${{ github.workflow }}\`*`; - - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: output - }) + *Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Working Directory: \`${{ env.tf_actions_working_dir }}\`, Workflow: \`${{ github.workflow }}\`*