Here-string is not POSIX compliant #1
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Feature
Kind/Rewrite
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
actions/docker-build#1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Plain
sh(POSIX compliant) does not support here-strings (<<<).This loop will produce a syntax error:
while read tag; dofull_tag="$DOCKER_TAG_PREFIX$tag"docker image tag "$IMAGE_ID" "$full_tag"done <<< "$DOCKER_TAGS"One possible fix would be something like this:
This has the disadvantage of running the loop in a subshell, which would make persistence of variables more complex (which will be required in the future to produce workflow outputs).
According to this StackOverflow answer, the here-string could also be replaced by a here-document:
But honestly - it looks kinda weird. Doesn't really matter for functionality, I just don't like it.
I have not yet tested how this would behave with newlines.