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

Customise comment text #73

Open
rossjrw opened this issue Dec 20, 2023 · 2 comments
Open

Customise comment text #73

rossjrw opened this issue Dec 20, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@rossjrw
Copy link
Owner

rossjrw commented Dec 20, 2023

Relates to #25 (comment)

It'd be good to be able to customise the text of the comment left by the action.

I figure it should be possible to let the user pass a string argument which can be used as the message for the marocchino/sticky-pull-request-comment step, with the current message string being the default argument.

The user could be able to use this argument to opt-out of the comment, e.g. it could skip the step if the comment is false or if it's an empty string. That behaviour might even make it possible for the user to change whether or not they want to post a comment based on various conditions. Possible use case: user wants to use their own comment/notification mechanism.

I was initially worried about code injection (https://docs.github.com/en/enterprise-cloud@latest/actions/security-guides/security-hardening-for-github-actions#understanding-the-risk-of-script-injections), given that I'd have to pass a string containing variables to be interpolated, but I don't think this is actually a problem at all because the user will write that string in their workflow file and the variables will be interpolated there.

I'm not clear on how to get env variables into the string that will only be known at runtime, though (e.g. ${{ env.pagesurl }} in the current string. Might Just Work with no changes needed, might need some thought.

@rossjrw rossjrw added the enhancement New feature or request label Dec 20, 2023
@josephluck
Copy link

josephluck commented Jan 3, 2024

Just a thought - it might be good idea to have an input to control whether a comment is posted or not. Then, users can customise their comment using marocchino/sticky-pull-request-comment directly with this action's deployment-url output.

@vincerubinetti
Copy link

I know you'd like to add a generic solution instead of a hard-coded one, but I think you should really add the "(as soon as GitHub finishes deploying it)" comment I suggested here as soon as possible. I've gotten several comments on my template that uses this action being confused as to why the changes weren't there immediately. Even just saying "will be available soon" (without linking to the pages deployment workflow run) would be great.

Another reason why this is relevant right now:

I thought that GitHub would've really tried to get their own PR preview system up and running ASAP (to take business away from Netlify and the like), but they just recently commented on that discussion saying that it's not coming any time soon (probably not even this year). So unfortunately, this puts more pressure on you because your action is the only thing on the market to accomplish this atm ;)

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

No branches or pull requests

3 participants