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

Comment on the pull request #187

Open
kevgo opened this issue Jun 29, 2022 · 7 comments
Open

Comment on the pull request #187

kevgo opened this issue Jun 29, 2022 · 7 comments

Comments

@kevgo
Copy link

kevgo commented Jun 29, 2022

It would be nice if this action would also add a comment to the pull request directly. Here is an example for how that could look like:

image

The message should - of course - be configurable via an input option.

Implementing this is pretty straightforward:

github.rest.issues.createComment({
  issue_number: context.issue.number,
  owner: context.repo.owner,
  repo: context.repo.repo,
  body: "Please make the title of this Pull Request follow the [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) format 🙏"
})
@amannn
Copy link
Owner

amannn commented Jun 29, 2022

Can this be achieved with #178?

@jthegedus
Copy link

I personally think providing the error as an Action Step Output is different to enabling the Action to comment the issue and a suggestion on the PR itself.

I would suggest these are separate issues, though my comment in #178 was due to the OPs Issue body seems to indicate wanting PR comments vs the Issue title requests Step output for manual composition in Actions.

I would love to see some terse error with a suggestion, like https://github.com/jef/conventional-commits-pr-action but with less text.

@kevgo
Copy link
Author

kevgo commented Jun 29, 2022

People can definitely build their own logic to add comments using #178. But that's pretty cumbersome. I think notifying the user about incorrect formatting of their pull request is a part of the core feature set of this GitHub Action.

@kevgo kevgo closed this as completed Jun 29, 2022
@jthegedus
Copy link

As I state above, I think commenting on PRs and Action outputs are different. Can we reopen this or should I create another Issue to specifically track comments on PR feature request?

@amannn
Copy link
Owner

amannn commented Jun 30, 2022

To be honest I currently don't really see the value of commenting on pull requests. I'd like to keep the noise of this action to a minimum, so in case you follow the provided configuration, you shouldn't hear anything from this action. Only when things go wrong there should be an error message and I think checks work really well for that. Having a comment repeat what a check already provides doesn't seem useful to me.

However, with #178 you could build such a workflow yourself if you have a use case where this makes more sense. I saw there are actions like https://github.com/marketplace/actions/comment-pull-request which might help to redirect the output to a PR comment.

@jthegedus
Copy link

jthegedus commented Jun 30, 2022

Having a comment repeat what a check already provides doesn't seem useful to me.

I disagree. Seeing that the check failed does not tell you why it failed. You have to click through via the "details" link to see the Action execution details. From my experience on asdf, no external contributors understand that this check failed or why, no one clicks through, and the maintainers have to resolve semantic-pr issues. Contributors are more likely to respond to comments on their PRs than the checks themselves. The education piece is missing.

Not to mention this could be opt-in, so it's only noisy for those who want the noise. I want the noise to stop me having to make noise manually.

@kevgo kevgo reopened this Jun 30, 2022
@kevgo
Copy link
Author

kevgo commented Jun 30, 2022

At our project, many non-developers use GitHub pull requests to manage things like blog posts or job postings. Most of these users are not comfortable clicking on a broken CI status and sifting through very technical steps and their console output.

I think getting a friendly comment on a pull request that explains in plain English (or French|Spanish|Chinese) what exactly the problem is and links to further documentation is a lot more user friendly for these people than the current behavior.

I think it would be completely okay if this feature is disabled by default. This GitHub Action doesn't even need to provide a default text. All that is needed from my perspective is a string input parameter that when set posts the given text as a comment on the pull request.

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

3 participants