Go-github-app - Template for building GitHub Apps in Go.

Template for GitHub Apps built with Golang

Build, Test and Lint Action Release Action Quality Gate Status Maintainability Test Coverage Go Report Card

Blog Posts - More Information About This Repo

You can find more information about this project/repository and how to use it in following blog post:

  • Soon...

Quick Start

To use this repository as starter for your project you can run configure_project.sh script, which sets up all variables and file names. This way you can avoid configuring and renaming things yourself:

./configure_project.sh \
    APP_ID="54321" \
    INSTALLATION_ID="987654321" \
    WEBHOOK_SECRET="verysecret" \
    KEY_PATH="./github_key.pem" \
    REGISTRY="ghcr.io/<GITHUB_USERNAME>/go-github-app"

Running

make container  # Builds containerized application
make run        # Runs container at localhost

# From another terminal:
curl http://localhost:8080/api/v1/github/pullrequests/octocat/hello-world

Testing

Test are run inside container image, equivalent to the container in which the application runs. To run tests:

make test

Running tests:
?   	github.com/MartinHeinz/go-github-app/cmd/app	[no test files]
ok  	github.com/MartinHeinz/go-github-app/cmd/app/apis	0.010s
?   	github.com/MartinHeinz/go-github-app/cmd/app/config	[no test files]
?   	github.com/MartinHeinz/go-github-app/cmd/app/httputil	[no test files]
?   	github.com/MartinHeinz/go-github-app/cmd/app/test_data	[no test files]
?   	github.com/MartinHeinz/go-github-app/cmd/app/utils	[no test files]
ok  	github.com/MartinHeinz/go-github-app/cmd/app/webhooks	0.006s
?   	github.com/MartinHeinz/go-github-app/pkg	[no test files]

Checking gofmt: PASS

Checking go vet: PASS

CI/CD

Predefined CI/CD uses GitHub Actions:

  • Build, Test, Lint Workflow (build.yaml):

    • Builds binary and container image
    • Runs tests and generates code coverage report
    • Performs SonarCloud code analysis
    • Sends coverage starts to CodeClimate
  • Release Workflow (release.yaml, triggered on tag creation):

    • Builds container image
    • Pushes the image to GitHub container registry
Owner
Martin Heinz
Software developer/DevOps engineer from Slovakia, living in Bratislava and currently working at IBM. Working with Python, Docker, OpenShift, Golang, Vue.js.
Martin Heinz
Similar Resources

🔎 gowatch Live reload for go apps.

Watch 🔎 gowatch Live reload for go apps Motivation I had no app to live reload my Go programs. Usage Install go install github.com/gelfand/gowatch ◆

Dec 29, 2021

KubeOrbit is an open-source abstraction layer library that turns easy apps testing&debuging on Kubernetes in a new way

KubeOrbit is an open-source abstraction layer library that turns easy apps testing&debuging on Kubernetes in a new way

KubeOrbit is an open-source abstraction layer library that turns easy apps testing&debuging on Kubernetes in a new way

Jan 6, 2023

Vagrant is a tool for building and distributing development environments.

Vagrant Website: https://www.vagrantup.com/ Source: https://github.com/hashicorp/vagrant HashiCorp Discuss: https://discuss.hashicorp.com/c/vagrant/24

Jan 7, 2023

library to make building things with bitclout easy

cloutcli library to make building things with bitclout easy quick start demo cmd $ ./clout demo clout demo visualizegraph # make clout.gv graph fi

Jul 27, 2022

Kratix is a framework for building Platform-as-a-Product

Kratix is a framework for building Platform-as-a-Product

Kratix κρατήστε μια υπόσχεση | kratíste mia ypóschesi | Keep a promise Kratix is a framework for building Platform-as-a-Product. Kratix enables platfo

Dec 31, 2022

Substation is a cloud native toolkit for building modular ingest, transform, and load (ITL) data pipelines

Substation Substation is a cloud native data pipeline toolkit. What is Substation? Substation is a modular ingest, transform, load (ITL) application f

Dec 30, 2022

GitOops is a tool to help attackers and defenders identify lateral movement and privilege escalation paths in GitHub organizations by abusing CI/CD pipelines and GitHub access controls.

GitOops is a tool to help attackers and defenders identify lateral movement and privilege escalation paths in GitHub organizations by abusing CI/CD pipelines and GitHub access controls.

GitOops is a tool to help attackers and defenders identify lateral movement and privilege escalation paths in GitHub organizations by abusing CI/CD pipelines and GitHub access controls.

Jan 2, 2023

github-actions-merger is github actions that merges pull request with commit message including pull request labels.

github-actions-merger github-actions-merger is github actions that merges pull request with commit message including pull request labels. Usage Write

Dec 7, 2022

Clones github projects into ~/Projects/github/{org}/{repo}

Tidy clone Github cli extension (gh extension) to clone repos into ~/Projects/github/{org}/{repo} on the local filesystem Install gh extension install

Jan 19, 2022
Comments
  • How to Merge a PR

    How to Merge a PR

    HI Martin, I'm newbie with go and I've learn a lots with go by your repo, May I have a question that how can I write func that can help me merge a PR ? I'm too newbie, and try to do more things with go.

    I'm trying to put a method here : main.go

    		v1.PUT("/github/repos/:owner/:repo/pulls/:pull_number/merge ", apis.MergePR)
    

    then I wrote a func in github.go

    func MergePR(c *gin.Context) {
    	owner := c.Param("owner")
    	repo := c.Param("repo")
    	pull_number := c.Param("pull_number")
    
    }
    

    But I dont know howw to do a PUT action within func.

    Thanks

Tigris is a modern, scalable backend for building real-time websites and apps.

Tigris Data Getting started These instructions will get you through setting up Tigris Data locally as Docker containers. Prerequisites Make sure that

Dec 27, 2022
Provider-template - Template for writing providers for crossplane

provider-template provider-template is a minimal Crossplane Provider that is mea

Feb 3, 2022
How to get a Go / Golang app using the Gin web framework running natively on Windows Azure App Service WITHOUT using a Docker container

Go on Azure App Service View the running app -> https://go-azure-appservice.azurewebsites.net ?? This is an example repo of how to get a Go / Golang a

Nov 28, 2022
This is for managing Slack App Manifests, it is no use if you are not developing an App for Slack.

Terraform Provider Slack App This is for managing Slack App Manifests, it is no use if you are not developing an App for Slack. Requirements Terraform

May 23, 2022
Go-github-actions - `go-github-actions` is a package for developing GitHub Actions

go-github-actions go-github-actions is a package for developing GitHub Actions.

Feb 6, 2022
GitHub App to set and enforce security policies

Allstar Allstar is a GitHub App installed on organizations or repositories to set and enforce security policies. Its goal is to be able to continuousl

Jan 5, 2023
GitHub Rate Limits Prometheus exporter. Works with both App and PAT credentials
GitHub Rate Limits Prometheus exporter. Works with both App and PAT credentials

Github Rate Limit Prometheus Exporter A prometheus exporter which scrapes GitHub API for the rate limits used by PAT/GitHub App. Helm Chart with value

Sep 19, 2022
Koyeb is a developer-friendly serverless platform to deploy apps globally.
Koyeb is a developer-friendly serverless platform to deploy apps globally.

Koyeb Serverless Platform Deploy a Go Gin application on Koyeb Learn more about Koyeb · Explore the documentation · Discover our tutorials About Koyeb

Nov 14, 2022
I'd like to share random apps in the spare times. Thus, I'm going to try learning some concepts of Go and as much as I can I try to clarify each line.

go-samples I'd like to share random apps in the spare times. Thus, I'm going to try learning some concepts of Go and as much as I can I try to clarify

Mar 16, 2022
sample apps docker with postgres-node.js-golang

Belajar Docker untuk Pemula - Membuat TODO App TODO app ini adalah contoh app untuk mendemokan proses membuat aplikasi dengan Docker, terdiri dari: Fr

Jan 2, 2022