Skyscraper

GitHub Enterprise Command-line Alias

To keep to my cli-workflow, I make regular use of the GitHub CLI tool, gh on the command line. The manual specifies that you can specify the GH_HOST environment variable to direct it to a GitHub Enterprise server, but I don’t want to have to type that in every time. I added the following to my .bashrc: ghe() { GH_HOST="github.example.com" gh "$@"; } complete -o default -F __start_gh ghe Now, I can just run gh for public GitHub actions, and ghe for anything to do with example.com’s server. ...

November 20, 2022 · 2 min · Jason Lavoie
Process flow of a GitHub AWS Connector App connecting to CodePipeline and publishing to an SNS topic

Connecting GitHub to SNS using CodePipeline

Background In the last post, I documented an approach to fan-out GitHub repository updates to AWS services using API Gateway, Lambda, and SNS. In my conclusion, I wrote: The whole time I was building and testing this, I kept thinking to myself, “I must be overlooking a more obvious solution.” I’ve asked around, and it seems that others have also run into this issue, but ended up using a different approach that didn’t involve authorization. If you know of a better/different solution, please reach out! ...

August 20, 2021 · 7 min · Jason Lavoie
Process flow of a webhook through API Gateway using a lambda integration to publish to SNS

Publish to SNS with GitHub webhooks

Motivation and Design I have a bunch of “audit scripts” that run against the network configurations (and other data sources, such as DNS and DHCP) to check for common problems, mistakes, and inconsistencies. They run on a centralized server that periodically fetches the latest data from all these sources, runs the scripts, and emails about any discrepancies. This data sources are kept in git repositories, either updated by operations staff, or automatically. In the case of networking gear, by a tool called RANCID that collects the text configuration and output of many useful “show” commands and pushes any changes a git repository for the role/group of the device. ...

August 16, 2021 · 10 min · Jason Lavoie