From 0cce01d56fdb414e6b85cd28f7ffc458ff80484a Mon Sep 17 00:00:00 2001 From: Eduardo Ruiz Date: Thu, 13 Oct 2022 12:06:30 +0200 Subject: [PATCH] improve json & pr comment do not run when cancelled --- .github/workflows/ci.yml | 14 ++++++++------ .github/workflows/pr_comment.yml | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 068550749..2872e15a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,12 +44,14 @@ jobs: run: | echo "{ \"pr_number\": ${{ github.event.number }}, - \"before\": \"${{ github.event.before }}\", - \"after\": \"${{ github.event.after }}\", - \"sha\": \"${{ GITHUB_SHA }}\", - \"ref\": \"${{ GITHUB_REF }}\", - \"from_branch\": \"${{ github.head_ref }}\", - \"to_branch\": \"${{ github.base_ref }}\", + \"head\": { + \"branch\": \"${{ github.head_ref }}\", + \"sha\": \"${{ github.event.after }}\" + }, + \"remote\": { + \"branch\": \"${{ github.base_ref }}\", + \"sha\": \"${{ github.event.before }}\" + }, \"html\": \"${{ github.event.pull_request._links.html.href }}\", \"additions\": ${{ github.event.pull_request.additions }}, \"deletions\": ${{ github.event.pull_request.deletions }}, diff --git a/.github/workflows/pr_comment.yml b/.github/workflows/pr_comment.yml index 329dcf7fe..df5e57257 100644 --- a/.github/workflows/pr_comment.yml +++ b/.github/workflows/pr_comment.yml @@ -11,6 +11,7 @@ on: jobs: create_test_summary_report: + if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure'}} # if: github.repository == 'hablapps/doric' runs-on: ubuntu-latest name: Create testing summary comment @@ -34,7 +35,7 @@ jobs: id: output_pr_context shell: bash run: | - content="$(cat pr_context.json/pr_context.json)" + content="$(cat pr_context.json)" echo "${content}" # the following lines are only required for multi line json content="${content//'%'/'%25'}"