Run a raffle among the π stargazers π of a Github project!
It is designed to run directly on Github actions but it can also be used locally on your command line. The CI build is configured with the repository we want the raffle to run against. Once completed, the winner will be listed as a comment of this issue in the following way.
βΉοΈ 14 requests made to Github API βΉοΈ
π π π @username π π π
- from 378 π stargazers of https://github.com/author/repo!
You need to have a JDK and scala-cli installed, or you can use the given Nix shell.
The following command makes a binary named raffle
.
$ nix-shell
$ scala-cli package . -o raffle -f
Run the raffle binary passing two arguments: author and repo name.
$ ./raffle
Missing expected positional argument!
Usage: stargazers-raffle [] [--show-all-users] <author> <repo>
Stargazers Raffle
Options and flags:
--help
Display this help text.
--version, -v
Print the version number and exit.
--show-all-users, -s
Display all the stargazers before raffle
--post-winner
Post the winner on the designated Github issue
Environment Variables:
GH_TOKEN=<string>
Github personal access token
For example.
$ ./raffle gvolpe dconf2nix --post-winner
βΉοΈ 2 requests made to Github API βΉοΈ
πππ @username πππ
* from 50 π stargazers of https://github.com/gvolpe/dconf2nix!
βοΈ Done. See https://github.com/gvolpe/stargazers-raffle/issues/1