Is it possible to give multiline inputs in github actions workflow_dispatch?
Asked Answered
T

1

8

I have a workflow and I need to give multiline input to workflow. Something like below:

name: Test
on:
  workflow_dispatch:
    inputs:
      change-log:
        description: 'Changelog'
        required: true

Here my changelog is multiline and when I am using the input it's not coming properly. Is there any way to pass multiline input correctly to a GitHub action?

Throes answered 9/9, 2021 at 9:39 Comment(3)
I've seen a similar question on the Github Community without any answer from the support team yet. It may not be possible at the moment :/Modest
@GuiFalourd, someone answered yet; answer linkCidevant
@DiegoBandeira, any idea what the answer was? That link is dead.Earthaearthborn
R
1

At the time of writing this answer, there are no updates about this.

There was an answer on Github communinty and they mentioned that it will be added to their backlog tho.

Until then we found a couple of workarounds, either by passing the changelog as a one-line JSON string and parsing it in our workflow (something like this), or we create more inputs for our workflow_dispatch, I mean something like

name: Test
on:
  workflow_dispatch:
    inputs:
      entry-header:
        description: 'Version and date'
        required: true
      added:
        description: List of Additions, example: '["Added foo", "Added bar"]'
        required: true
        default: '[]'

      changed:
        description: List of changes, example: '["Changed foo", "Changed bar"]'
        required: true
        default: '[]'

Or, if you are using workflow_call, you can create a multi-line environment variable and just pass it to your workflow (this one might be unrelated to this example/request)

Retrograde answered 20/2, 2023 at 8:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.