Repository navigation
Replies: 1 comment
|
Two ways, depending on whether you mind the newlines ending up in the value. The action splits the input on newlines, but it parses it with a CSV parser, and a double-quoted field is allowed to span lines. So quoting the whole build-args: |
COMPONENTS=mqtt|buienradar|denonavr
"CUSTOM_COMPONENTS=https://github.com/golles/ha-knmi/archive/refs/tags/v3.0.4.tar.gz|
https://github.com/danielrivard/homeassistant-innova/archive/refs/tags/v1.5.1.tar.gz"That does give you a single If you want it readable in the workflow and clean when it arrives, fold it in YAML instead. In a double-quoted scalar a trailing backslash eats the newline completely — no space, no env:
CUSTOM_COMPONENTS: "https://github.com/golles/ha-knmi/archive/refs/tags/v3.0.4.tar.gz|\
https://github.com/danielrivard/homeassistant-innova/archive/refs/tags/v1.5.1.tar.gz|\
https://github.com/marcolivierarsenault/moonraker-home-assistant/archive/refs/tags/v1.2.0.tar.gz"
jobs:
build:
steps:
- uses: docker/build-push-action@v6
with:
build-args: |
COMPONENTS=mqtt|buienradar|denonavr
CUSTOM_COMPONENTS=${{ env.CUSTOM_COMPONENTS }}The arg reaches the Dockerfile as one unbroken |
Uh oh!
There was an error while loading. Please reload this page.
For some build I use a delimited string as input to loop over and do some action on in the Dockerfile. For example:
https://github.com/LANsible/docker-home-assistant/blob/main/.github/workflows/docker.yml#L19
https://github.com/LANsible/docker-home-assistant/blob/main/Dockerfile#L49
This now becomes one line, it would be nice to be able to split this across multiple lines, anyone an idea?
Something like this?
I tried a couple different things but couldn't get it to work, anyone some input? If refactoring the
build-argsis required that is fine by me as well, I am open for suggestion.Thanks all <3
All reactions