stargazers-raffle

Run a raffle among the 🌟 stargazers 🌟 of a Github project!

APACHE-2.0 License

Stars
10

stargazers-raffle

Run a raffle among the stargazers of a Github project!

Overview

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

Run it locally

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