diff --git a/.github/templates/pr_comment.md b/.github/templates/pr_comment.md index 54275b5ca..31a47aee5 100644 --- a/.github/templates/pr_comment.md +++ b/.github/templates/pr_comment.md @@ -1,3 +1,12 @@ -This is an auto-generated comment created by: +:octocat: This is an auto-generated comment created by: - workflow: {{ .workflow }} +- run: {{ .run_url }} +- attempt: {{ .attempt }} +- previous attempt: .previous_attempt +- job name: {{ .job_name }} + +Test summary report 📊 + +| Spark version | testing | +|:-------------:|:-------------:| diff --git a/.github/workflows/pr_comment.yml b/.github/workflows/pr_comment.yml index c43cdae4f..b2b705abf 100644 --- a/.github/workflows/pr_comment.yml +++ b/.github/workflows/pr_comment.yml @@ -4,14 +4,15 @@ on: workflow_run: workflows: [CI] # branches: [main] -# types: -# - completed + types: + - completed #permissions: # pull-requests: write jobs: - add_comment: + create_test_summary_report: +# if: github.repository == 'hablapps/doric' runs-on: ubuntu-latest name: Create testing summary comment steps: @@ -20,8 +21,10 @@ jobs: # GITHUB_CONTEXT: ${{ toJson(github) }} # run: | # echo "$GITHUB_CONTEXT" + - name: Find Comment # if: github.event_name == 'pull_request' +# if: ${{ github.event.workflow_run.conclusion == 'success/failure' }} uses: peter-evans/find-comment@v2 id: fc with: @@ -30,13 +33,16 @@ jobs: - uses: actions/checkout@v3 - - name: Render template - id: template - uses: chuhlomin/render-template@v1.4 - with: - template: .github/templates/pr_comment.md - vars: | - workflow: ${{ github.workflow }} +# - name: Render template +# id: template +# uses: chuhlomin/render-template@v1.4 +# with: +# template: .github/templates/pr_comment.md +# vars: | +# workflow: ${{ github.workflow }} +# run_url: [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) +# attempt: ${{ github.event.workflow_run.run_attempt }} +# job_name: ${{ github.job }} - name: Create summary comment uses: peter-evans/create-or-update-comment@v2 with: @@ -44,7 +50,101 @@ jobs: issue-number: ${{ github.event.workflow_run.pull_requests[0].number }} token: "${{ secrets.GITHUB_TOKEN }}" edit-mode: replace - body: ${{ steps.template.outputs.result }} +# body: ${{ steps.template.outputs.result }} + body: | + :octocat: This is an auto-generated comment created by: + + - workflow: ${{ github.workflow }} + - run: [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) + - attempt: ${{ github.event.workflow_run.run_attempt }} + - previous attempt: (${{ github.event.workflow_run.previous_attempt_url }}) + - job name: ${{ github.job }} + +
Actor | +Triggering actor | +Sender | +
+
+
+ + ${{ github.event.workflow_run.actor.login }} + + |
+
+
+
+ + ${{ github.event.workflow_run.triggering_actor.login }} + + |
+
+
+
+ + ${{ github.event.sender.login }} + + |
+
---|---|---|
+ Triggered by: + + - [${{ github.event.workflow_run.name }}](${{ github.event.workflow_run.path }}) + - [${{ github.event.workflow_run.html_url }}](${{ github.event.workflow_run.html_url }}) + + on ${{ github.event_name }} ${{ github.event.action }} + | ||
+ Commit: + + - ${{ github.event.workflow_run.head_commit.message }} + - ${{ github.event.workflow_run.head_commit.id }} + |