Skip to content

Conversation

@goruha
Copy link
Member

@goruha goruha commented Dec 23, 2025

what

  • Change the way how docker build output metadata is processed to handle escape character

why

  • Metadata JSON from docker-build-push-action contains head/merge commit details including message which might include single quotes
  • get-metadata step wraps the JSON in single quotes causing the build step to break if merge commit contains a single quote character (e.g. as part of commit description):
Run metadata=$(echo '{
...
/home/runner/work/_temp/b76bb997-9a9b-4a18-ac9f-321762ea58ba.sh: line 79: syntax error near unexpected token `('
Error: Process completed with exit code 2.
# OR
/home/runner/_work/_temp/5912f8a7-4a6e-4f73-a4c5-b6730c3ebf58.sh: line 456: unexpected EOF while looking for matching `"'
Error: Process completed with exit code 2.
  • Simple way to reproduce the error locally:
metadata=$(echo '{ "message": "that's fine" }' | jq -c)
  • The native bash way to escape single quotes would be to replace ' with '', however, GHA provide toJSON method which automatically escape characters when used in ENV (reference below)

references

@goruha goruha merged commit 1d99c39 into main Dec 24, 2025
18 checks passed
@goruha goruha deleted the k0ff33-main branch December 24, 2025 00:11
@github-actions
Copy link

These changes were released in v2.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants