- SWI-Prolog package for interacting with sourcehut via GraphQL - replies

This is very cool, I like it!

I’ll have to use this in the srht CI steps for my automake package…the current shell script that’s generating GraphQL is very terrible :sweat_smile:


To make this use case a little easier, I’ve added a command-line interface to which can be used instead of invoking swipl -g "use_module(sourcehut/git)...." inside a Makefile or CI manifest. The CLI is called hutpl and it’s available from the installation directory of pack(sourcehut) after one runs pack_install(sourcehut).
So something like export PATH=$PATH:$(swipl -g 'absolute_file_name(pack(sourcehut), P), writeln(P)' -t halt) makes it available everywhere.

Then you can use hutpl git artifact upload <repo-id> <tag> <local-path> to upload an artifact.
To get the repo ID from it’s name, something like hutpl git repo eshel | jq .id can be used.

1 Like