You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just stumbled across a weird issue, where the action would suddenly fail (after quite a while not being executed at all).
After digging into the issue, it seems that the short-description limit is not correctly enforced.
The short-description input was introduced with 8fa8201, which already truncates inputs longer than 100 characters (since otherwise the API would return a status code 400 / Bad Request):
However, it seems that the limit differs when using supplementary characters like emojis. I did some tests, and it turns out that 1 supplementary character seems to be equal to 4 ASCII characters:
The run with 26 emojis results in the following error:
##[debug]Inputs: {
##[debug] username: '***',
##[debug] password: '***',
##[debug] repository: '***/dockerhub-description-tests',
##[debug] shortDescription: '💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻',
##[debug] readmeFilepath: './README.md',
##[debug] enableUrlCompletion: false,
##[debug] imageExtensions: 'bmp,gif,jpg,jpeg,png,svg,webp'
##[debug]}
Reading description source file
##[debug]💻
Acquiring token
::add-mask::***
Sending PATCH request
##[debug]Error: Bad Request
##[debug] at /home/runner/work/_actions/peter-evans/dockerhub-description/v3/dist/index.js:83:23
##[debug] at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Bad Request
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Docker Hub Description
This could be explained by UTF-8 being a variable-length content-encoding where code-points with lower numerical values are using fewer bytes. This would basically mean that the limit of 100 is actually a limit of 100 bytes, not 100 characters.
The text was updated successfully, but these errors were encountered:
Thank you for your detailed report of this issue. It would not surprise me that it should be 100 bytes, not 100 characters. The readme content already works this way and I truncate to a byte limit while respecting unicode surrogate pairs. I just need to add that functionality to the short-description, too, it seems. I'll make a fix for this soon.
I just stumbled across a weird issue, where the action would suddenly fail (after quite a while not being executed at all).
After digging into the issue, it seems that the
short-description
limit is not correctly enforced.The
short-description
input was introduced with 8fa8201, which already truncates inputs longer than 100 characters (since otherwise the API would return a status code 400 / Bad Request):dockerhub-description/src/dockerhub-helper.ts
Line 39 in 3ba533f
However, it seems that the limit differs when using supplementary characters like emojis. I did some tests, and it turns out that 1 supplementary character seems to be equal to 4 ASCII characters:
The run with 26 emojis results in the following error:
This could be explained by UTF-8 being a variable-length content-encoding where code-points with lower numerical values are using fewer bytes. This would basically mean that the limit of 100 is actually a limit of 100 bytes, not 100 characters.
The text was updated successfully, but these errors were encountered: