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

Showing the number of lines changed as a comment #9

Open
windybranch opened this issue Mar 12, 2024 · 2 comments
Open

Showing the number of lines changed as a comment #9

windybranch opened this issue Mar 12, 2024 · 2 comments

Comments

@windybranch
Copy link

It would be a nice feature to see the number of lines changed as a comment on the PR so that the reviewer doesn't need to check the results of the GitHub Action.

@hovsep
Copy link

hovsep commented Jan 17, 2025

you can do something like

  comment_fail:
    needs: check_pr_size
    if: failure()
    runs-on: ubuntu-latest
    steps:
      - name: Comment on PR when PR size check fails
        uses: peter-evans/create-or-update-comment@v4
        with:
          issue-number: ${{ github.event.pull_request.number }}
          body: |
            **❌ PR is too big !**
            **The number of lines changed in this PR (${{ needs.check_pr_size.outputs.total_lines_changed }}) exceeds the allowed limit (${{ env.PR_SIZE_LIMIT }}) lines.**
            **⚡ Consider breaking it into smaller PRs to improve review quality and avoid merge conflicts**

@windybranch
Copy link
Author

you can do something like

comment_fail:
needs: check_pr_size
if: failure()
runs-on: ubuntu-latest
steps:
- name: Comment on PR when PR size check fails
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
❌ PR is too big !
The number of lines changed in this PR (${{ needs.check_pr_size.outputs.total_lines_changed }}) exceeds the allowed limit (${{ env.PR_SIZE_LIMIT }}) lines.
⚡ Consider breaking it into smaller PRs to improve review quality and avoid merge conflicts

Thanks for the suggestion! That's a good workaround for now but I'll leave this open as it would be nicer to integrate into the existing action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants