wzieba / AppCenter-Github-Action

This action uploads artifacts (.apk or .ipa) to Visual Studio App Center.
MIT License
78 stars 71 forks source link

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

Open tonyarnold opened 4 years ago

tonyarnold commented 4 years ago

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.

wzieba commented 4 years ago

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!

VladSumtsov commented 3 years ago

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

wzieba commented 3 years ago

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.

sgurdag commented 3 years ago

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.

tonyarnold commented 3 years ago

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

sgurdag commented 3 years ago

@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

tonyarnold commented 3 years ago

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.

p-fischer commented 1 year ago

@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 commented 1 year ago

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 }}