-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reverted pull-requests to issues write permissions (#664)
* Moved commenting PR to a standalone workflow to bypass permissions limitations * Reverd to default token
- Loading branch information
1 parent
bd92b37
commit 5adc19f
Showing
2 changed files
with
63 additions
and
18 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Pull Request Comment | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Benchmark Suite"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
upload: | ||
runs-on: ubuntu-latest | ||
if: > | ||
github.event.workflow_run.event == 'pull_request' && | ||
github.event.workflow_run.conclusion == 'success' | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: pr | ||
path: ./var/phpbench/pr-id.txt | ||
|
||
- name: save PR id | ||
id: pr | ||
run: | | ||
echo "id=$(<pr-id.txt)" >> $GITHUB_OUTPUT | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: phpbench | ||
path: ./var/phpbench/summary.txt | ||
|
||
- name: Get Benchmarks Output | ||
id: get-benchmarks | ||
run: | | ||
echo "content<<EOF" >> $GITHUB_OUTPUT | ||
echo "$(cat ./var/phpbench/summary.txt)" >> $GITHUB_OUTPUT | ||
echo EOF >> $GITHUB_OUTPUT | ||
- name: "Find Comment" | ||
uses: peter-evans/find-comment@v2 | ||
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@v3 | ||
with: | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
issue-number: ${{ steps.pr.outputs.id }} | ||
body: ${{ steps.get-benchmarks.outputs.content }} | ||
edit-mode: replace |
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