Pull Request Comment #981
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pull Request Comment | |
on: | |
workflow_run: | |
workflows: ["Test Benchmarks"] | |
types: | |
- completed | |
jobs: | |
pr-comment: | |
name: "Pull Request Comment" | |
runs-on: ubuntu-latest | |
if: > | |
github.event.workflow_run.event == 'pull_request' && | |
github.event.workflow_run.conclusion == 'success' | |
steps: | |
- name: Download pull request id artifact | |
uses: dawidd6/action-download-artifact@v8 | |
with: | |
run_id: ${{ github.event.workflow_run.id }} | |
name: pr | |
path: ./var/phpbench/pr | |
- name: Save PR id | |
id: pr | |
run: | | |
echo "id=$(<./var/phpbench/pr/pr-id.txt)" >> $GITHUB_OUTPUT | |
- name: Download phpbench benchmarks artifact | |
uses: dawidd6/action-download-artifact@v8 | |
with: | |
run_id: ${{ github.event.workflow_run.id }} | |
name: phpbench | |
path: ./var/phpbench/summary/ | |
- name: Get benchmarks output | |
id: get-benchmarks | |
run: | | |
echo "content<<EOF" >> $GITHUB_OUTPUT | |
echo "$(cat ./var/phpbench/summary/summary.txt)" >> $GITHUB_OUTPUT | |
echo EOF >> $GITHUB_OUTPUT | |
- name: Find comment | |
uses: peter-evans/find-comment@v3 | |
id: fc | |
with: | |
issue-number: ${{ steps.pr.outputs.id }} | |
comment-author: 'github-actions[bot]' | |
body-includes: '# Flow PHP - Benchmarks' | |
- name: Create or update comment | |
uses: peter-evans/create-or-update-comment@v4 | |
with: | |
comment-id: ${{ steps.fc.outputs.comment-id }} | |
issue-number: ${{ steps.pr.outputs.id }} | |
body: ${{ steps.get-benchmarks.outputs.content }} | |
edit-mode: replace |