A super simple bash script to check the status of a GitLab CI pipeline. ```sh $ git push ... $ git pipeline-status Status of last pipeline for user/project on gitlab/master: "pending" ... $ git pipeline-status Status of last pipeline for user/project on gitlab/master: "running" ... $ git pipeline-status Status of last pipeline for user/project on gitlab/master: "success" ``` ### Prerequisites Aside from `git` and `curl`, you will need `jq` (see https://stedolan.github.io/jq/, or just `brew install jq`). Your GitLab private access token needs to be set in an environment variable called `GITLAB_API_PRIVATE_TOKEN`. Your GitLab remote needs to be named either `gitlab` or `origin`. If it's not, you can override those via the `GITLAB_REMOTE` environment variable. `~/bin` needs to be in your `$PATH` ### Install 1. Copy the attached `git-pipeline-status` into your `~/bin` directory 2. Make it executable: `chmod +x ~/bin/git-pipeline-status` ### Usage `git pipeline-status` ### How?! "How does putting a random script in my `~/bin` make this work?" See [git source](https://github.com/git/git/blob/1a4e40aa5dc16564af879142ba9dfbbb88d1e5ff/git.c#L558) and [this coderwall blog post](https://coderwall.com/p/bt93ia/extend-git-with-custom-commands)