Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows/eval: Add the eval summary as a comment #361061

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,21 @@ jobs:
GH_TOKEN: ${{ github.token }}
REPOSITORY: ${{ github.repository }}
NUMBER: ${{ github.event.number }}

- name: Adding comments
Mic92 marked this conversation as resolved.
Show resolved Hide resolved
if: ${{ github.event_name == 'pull_request_target' }}
run: |
# Add the eval summary as a comment
body="$(jq -r '
"## [Eval summary](https://github.com/" + env.GH_REPO + "/actions/runs/" + env.GITHUB_RUN_ID + "?pr=" + env.NUMBER + ")\n\n" +
"- Added packages: " + (.attrdiff.added | length | tostring) + "\n" +
"- Removed packages: " + (.attrdiff.removed | length | tostring) + "\n" +
"- Changed packages: " + (.attrdiff.changed | length | tostring) + "\n" +
"- Rebuild Linux: " + (.rebuildCountByKernel.linux | tostring) + "\n" +
"- Rebuild Darwin: " + (.rebuildCountByKernel.darwin | tostring)
' <comparison/changed-paths.json)"
gh pr comment "$NUMBER" --edit-last --body "$body" || gh pr comment "$NUMBER" --body "$body"
Mic92 marked this conversation as resolved.
Show resolved Hide resolved
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.number }}
Loading