Skip to content

Commit

Permalink
message
Browse files Browse the repository at this point in the history
  • Loading branch information
moukoublen committed Mar 21, 2024
1 parent 19d7c1c commit a3286e9
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ jobs:
name: Upload integration tests results
runs-on: ubuntu-22.04
timeout-minutes: 60
permissions:
pull-requests: write
if: ${{ success() || failure() }}
steps:
- uses: actions/download-artifact@v4
Expand Down Expand Up @@ -320,4 +322,31 @@ jobs:
bucket: csp-allure-reports
prefix: allure_reports/cloudbeat/ci/${{ github.event.number }}
ignoreMissingResults: true
debug: true
debug: false

- name: Allure Summary
if: success()
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
jobs=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id}}/attempts/${{ github.run_attempt }}/jobs)
job_id=$(echo $jobs | jq -r '.jobs[] | select(.runner_name=="${{ runner.name }}") | .id')
allure_summary=$(curl --silent --show-error --fail --location "https://github.com/elastic/cloudbeat/actions/runs/${{ github.run_id }}/jobs/${job_id}/summary_raw")
# saving result into env variable (with multiline handling)
echo "ALLURE_SUMMARY<<EOF" >> $GITHUB_ENV
echo "$allure_summary" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Comment test success result
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ success() && github.event.workflow_run.event == 'pull_request' }}
with:
header: CI Test Results
number: ${{ github.event.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: |
${{ env.ALLURE_SUMMARY }}

0 comments on commit a3286e9

Please sign in to comment.