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

Overview

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
You might also like...
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

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

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

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

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

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

A template repository to quickly scaffold a Kubewarden policy written with Go language

go-policy-template This is a template repository that can be used to to quickly scaffold a Kubewarden policy written with Go language. Don't forget to

A simple Kubernetes Operator template that uses Golang, use it to build your own operators
A simple Kubernetes Operator template that uses Golang, use it to build your own operators

A simple programmatic Kubernetes Operator template. Use this to create your own Kubernetes operators with golang. Build with KIND (Kubernetes in Docke

Template Repository For Bug Reporting
Template Repository For Bug Reporting

Template Repository For Bug Reporting Create a Repository From the Template First and foremost, create a repository from this template repository (the

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

    opened by dinhdobathi1992 0
Releases(v0.0.1)
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
A simple Go app and GitHub workflow that shows how to use GitHub Actions to test, build and deploy a Go app to Docker Hub

go-pipeline-demo A repository containing a simple Go app and GitHub workflow that shows how to use GitHub Actions to test, build and deploy a Go app t

Marat Bogatyrev 0 Nov 17, 2021
Provider-template - Template for writing providers for crossplane

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

maros.zeleny 0 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

Ed Andersen 8 Sep 20, 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

ChangeEngine 2 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.

Ken’ichiro Oyama 1 Feb 6, 2022
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

Koyeb 2 Aug 27, 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

Mert Simsek 1 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

null 0 Jan 2, 2022
🔎 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 ◆

Eugene 0 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

TeamCode 448 Sep 15, 2022