Skip to content

Commit

Permalink
comment even if ci failure & comment if pr comment fails
Browse files Browse the repository at this point in the history
  • Loading branch information
eruizalo committed Sep 29, 2022
1 parent 1db96ae commit 1886f3c
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions .github/workflows/pr_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ jobs:
| Spark version | testing |
|:-------------:|:-------------:|
update_test_summary_report_ok:
update_test_summary_report:
needs: ["create_test_summary_report"]
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
name: Update comment OK
name: Update comment
steps:
- name: Download artifact
id: download_artifacts
uses: dawidd6/[email protected] # marcofaggian/[email protected]
with:
# names: test-summary-*.md
Expand All @@ -121,6 +121,7 @@ jobs:
if_no_artifact_found: fail

- name: Get summary
if: steps.download_artifacts.conclusion == 'success'
id: summary
# The content must be escaped to preserve newlines. --> https://github.com/orgs/community/discussions/26288
run: |
Expand All @@ -132,13 +133,16 @@ jobs:
shell: bash

- name: Find Comment
if: ${{ always() }}
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.workflow_run.pull_requests[0].number }}
body-includes: "This is an auto-generated comment"

- name: Add test results
if: steps.fc.conclusion == 'success'
id: add_test_results
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
Expand All @@ -147,20 +151,9 @@ jobs:
edit-mode: append
body: |
${{ steps.summary.outputs.summary }}
update_test_summary_report_ko:
needs: ["create_test_summary_report"]
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
runs-on: ubuntu-latest
name: Update comment KO
steps:
- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.workflow_run.pull_requests[0].number }}
body-includes: "This is an auto-generated comment"
- name: Add failed comment
if: ${{ failure() && steps.fc.conclusion == 'success' }}
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
Expand All @@ -169,4 +162,4 @@ jobs:
edit-mode: append
body: |
---------
Trigger workflow failed :interrobang: :flushed: :boom: :fire::fire::fire:
Something bad happened :interrobang: :flushed: :boom: :fire::fire::fire:

0 comments on commit 1886f3c

Please sign in to comment.