Resolve "latest" from appcast.json instead of the channel link - #39
Conversation
maxcleme
left a comment
There was a problem hiding this comment.
We recently move to appcast.json instead of appcast.xml, the following would be more accurate and stable. It should also make the whole action.yml simpler.
curl -s https://desktop.docker.com/linux/main/amd64/appcast.json \
| jq -r '.Items
| map(select(.Visibility == "100"))
| max_by(.BuildNumber | tonumber)
| .Artifacts[] | select(.Type == "deb") | .URL'
On Linux, docker-desktop-build-url: latest read //channel/link from appcast.xml -- a static channel pointer, not the newest build. It returns build 228796 while the feed holds 4.89.0 and 4.90.0, so every caller asking for "latest" silently installs a release many versions behind. Read appcast.json instead and take the highest build number among the items at full visibility: document order is not a reliable proxy for recency, and an item still rolling out is not yet the latest release. This collapses three steps into one and drops the get-xml-info dependency. It also stops interpolating the build-url input straight into the shell, which was a script injection vector.
409f0c4 to
c22c28c
Compare
|
Thanks @maxcleme — switched to I kept your jq almost verbatim, with one guard. When no item is at full visibility it fails confusingly: so there's now an Verified against the live feed: resolves to 238018 (4.89.0), since 4.90.0 is still at visibility 99. Also moved the |
|
hey @ctalledo we don't have permission either, maybe @docker/desktop-platform-go might have enough permissions? |
On Linux,
docker-desktop-build-url: latestread//channel/linkfromappcast.xml— a static channel pointer, not the newest build. It returns build 228796 while the feed holds 4.89.0 and 4.90.0, so every caller asking forlatestsilently installs a release many versions behind.Now reads
appcast.jsonand takes the highest build number among items at full visibility. Collapses three steps into one, drops theget-xml-infodependency, and stops interpolating the input straight into the shell.Verified against the live feed: resolves to 238018 (4.89.0); 4.90.0 is present but still at visibility 99.