AppCenter-Github-Action icon indicating copy to clipboard operation
AppCenter-Github-Action copied to clipboard

Question: how does this action handle multi-line release notes?

Open tonyarnold opened this issue 4 years ago • 9 comments

I've been calling the AppCenter CLI tool directly, and attempting to use the contents of ${{github.event.release.body}} to populate my release notes, however it appears that I need to do some pre-processing to convert the newlines/special characters to something more appropriate for use on the command line.

It doesn't look like this action does anything to help here, but I was thinking maybe it should?

Something simple to pre-process the incoming release notes text, or wrap the argument contents in a multiline argument directly would be super helpful.

tonyarnold avatar Sep 16 '20 08:09 tonyarnold

It doesn't look like this action does anything to help here, but I was thinking maybe it should?

That's true, I didn't pay attention to multi-line release notes. For sure it's good idea, I will check the possibilities. Thanks for rising* this issue!

wzieba avatar Sep 16 '20 08:09 wzieba

Hi! Do you have any updates on this? :)

VladSumtsov avatar Mar 18 '21 09:03 VladSumtsov

hi @VladSumtsov 👋 no, sorry I didn't prioritize it - I don't have any updates on this. I'll happily welcome any PR but for now, I don't have enough time to do this myself.

wzieba avatar Mar 21 '21 12:03 wzieba

Here is how i do it :

 releaseNotes: |+

                       Initiated by **${{github.actor}}** --- **Github Actions**
                       - ${{github.workflow}}
                       - ${{github.ref}}
                       - Build (${{github.run_number}})

The magic is starting with |+ . Then each line in yaml file will be shown in new line in AppCenter.

sgurdag avatar Jun 23 '21 16:06 sgurdag

@sgurdag that's an interesting bit of info - does it work if you push through a multi-line string as per this issue?

tonyarnold avatar Jun 24 '21 12:06 tonyarnold

@sgurdag that's an interesting bit of info - does it work if you push through a multi-line string as per this issue?

Hey @tonyarnold, Yes,It does. You can see my release note on appcenter here:

Screenshot 2021-06-24 at 20 46 41

It is the way of having multi-lines in YAML as it is explicitly mentioned in syntax doc here : https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html

sgurdag avatar Jun 24 '21 19:06 sgurdag

I'm dubious about whether this will work with a multi-line replacement like ${{github.event.release.body}} — I'll have to give it a try for my next beta release.

tonyarnold avatar Jun 24 '21 23:06 tonyarnold

@tonyarnold I tested this with a multi-line replacement. See this snippet:

releaseNotes: |
  ${{ steps.extract-release-notes.outputs.release_notes }}

Unfortunately, it didn't work.

Another good and clean solution to support multi-line release notes would be to provide the release notes in a file and to support the CLI parameter release-notes-file

p-fischer avatar Jun 02 '23 18:06 p-fischer

Update: The approach can work. It failed in my test because the release notes started with - . However, if they don't start with a minus it does work.

I worked around the limitation by adding a title in the YAML-config:

releaseNotes: |+
  Release notes:
  ${{ steps.extract-release-notes.outputs.release_notes }}

p-fischer avatar Jun 02 '23 20:06 p-fischer