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

Custom pull descriptions #64

Merged
merged 4 commits into from
Jun 25, 2021
Merged

Custom pull descriptions #64

merged 4 commits into from
Jun 25, 2021

Conversation

korthout
Copy link
Owner

Adds a new input configuration option: pull_description.

The value is used as template for the description of pull requests created by this action.
Placeholders can be used to define variable values.
These are indicated by a dollar sign and curly braces (${placeholder}).

The action.yml and example workflows simply refer to the README for all available placeholders.
The README contains a new subsection (Placeholders) under Installation, to specify the available placeholders and what they are replaced with.

closes #51

korthout added 4 commits June 12, 2021 15:08
To allow users to configure the description used in the pull requests
created by this action. The default stays the same.

In order to stay the same, and add something meaningful to the
descriptions. This also allows the use of placeholders to define
variable values.

For now, this is just a simple replacement of exact matches, but in the
future we could consider escaping these placeholders if there is a need
for it.
@negz
Copy link

negz commented Jun 15, 2021

Thanks @korthout! I sadly probably won't get a chance to test this out in until at least next week, but the implementation looks like exactly what I'd like.

@korthout
Copy link
Owner Author

@negz That's great to hear. I was planning on doing some additional testing today and then merging it, so I'm happy to hear you're positive about the config. Personally, I feel this feature also opens up the possibility to add more placeholders (e.g. related issues, something my team wants) without changing the current behavior for other users. So I believe this adds a lot of value. Thanks again for bringing up this idea.

@korthout
Copy link
Owner Author

I've tested it, and all works as expected: default + documented example.

You can also escape the hash character # with a backslash, like \# to please the GitHub yml editor. This does add the backslash to the actual description, but GitHub then simply ignores it when rendering the description. Personally, I prefer not escaping them.

I did note one small problem. Each placeholder can only occur once in the description. Only the first is replaced, the others are not. It's not really a bug, just the current behavior. Let's see if someone needs this at any point.

@korthout korthout merged commit 515fcdd into master Jun 25, 2021
nh2 added a commit to nh2/nixpkgs that referenced this pull request Jun 26, 2021
Automation tools should instruct their users clearly what tasks are still on the user.

Updates the bot's version to get the `pull_description` feature:
korthout/backport-action#64
@korthout korthout deleted the custom-pull-descriptions branch July 26, 2021 19:59
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

Successfully merging this pull request may close these issues.

Allow custom PR templates
2 participants