From c665bb827b22b31aa8e312075ea50dc3658f6d87 Mon Sep 17 00:00:00 2001 From: Karolina Rakoczy Date: Thu, 26 Sep 2024 12:51:22 +0200 Subject: [PATCH] Add comment to release PR after tests in CORE (#5172) * Add comment to release PR after tests in CORE * Fix branch name * Fix comment output * Fix comment output * Remove added values for testing purpose * Add chagesets * Update .changeset/fast-mirrors-mate.md Co-authored-by: Mikail <6186720+NyanKiyoshi@users.noreply.github.com> * Update .github/workflows/automation-tests-on-repository-dispatch.yml Co-authored-by: Mikail <6186720+NyanKiyoshi@users.noreply.github.com> --------- Co-authored-by: Mikail <6186720+NyanKiyoshi@users.noreply.github.com> --- .changeset/fast-mirrors-mate.md | 5 +++++ .../automation-tests-on-repository-dispatch.yml | 14 ++++++++++++++ .github/workflows/run-tests-on-release.yml | 4 ++++ 3 files changed, 23 insertions(+) create mode 100644 .changeset/fast-mirrors-mate.md diff --git a/.changeset/fast-mirrors-mate.md b/.changeset/fast-mirrors-mate.md new file mode 100644 index 00000000000..1fd436e47e6 --- /dev/null +++ b/.changeset/fast-mirrors-mate.md @@ -0,0 +1,5 @@ +--- +"saleor-dashboard": minor +--- + +Comment from tests results will now be displayed for cloud-deployments CORE release PRs diff --git a/.github/workflows/automation-tests-on-repository-dispatch.yml b/.github/workflows/automation-tests-on-repository-dispatch.yml index e938cdea2b5..dc54ff131bf 100644 --- a/.github/workflows/automation-tests-on-repository-dispatch.yml +++ b/.github/workflows/automation-tests-on-repository-dispatch.yml @@ -43,4 +43,18 @@ jobs: CUSTOM_VERSION: ${{github.event.client_payload.custom_version }} ADDITIONAL_TITLE: "Core automation test" secrets: inherit + + add-comment-to-release-pr: + needs: run-tests-on-release + runs-on: ubuntu-22.04 + steps: + - name: add-comment-to-release-pr + env: + PR_NUMBER: ${{github.event.client_payload.release_pr }} + PR_COMMENT: ${{needs.run-tests-on-release.outputs.PR_COMMENT}} + run: | + export GITHUB_TOKEN=$( \ + curl --request GET --url ${{ secrets.VAULT_URL}} --header "Authorization: JWT ${{ secrets.VAULT_JWT }}" | jq -r .token \ + ) + gh pr comment "$PR_NUMBER" --body "$PR_COMMENT" -R github.com/saleor/saleor-cloud-deployments \ No newline at end of file diff --git a/.github/workflows/run-tests-on-release.yml b/.github/workflows/run-tests-on-release.yml index 73dbd1af7dd..d1b0a07f811 100644 --- a/.github/workflows/run-tests-on-release.yml +++ b/.github/workflows/run-tests-on-release.yml @@ -40,6 +40,9 @@ on: RUN_URL: value: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" description: Url to job run + PR_COMMENT: + value: ${{ jobs.tests-complete.outputs.PR_COMMENT }} + description: Comment for release PR jobs: add-check-and-prepare-instance: @@ -233,6 +236,7 @@ jobs: timeout-minutes: 30 outputs: TESTS_CONCLUSION: "${{ steps.send-slack-message.outputs.status }}" + PR_COMMENT: "${{ steps.send-slack-message.outputs.status }} - run details: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" steps: - uses: actions/checkout@v4