Popularity
3.4
Growing
Activity
4.6
-
53
2
12

Description

Template for GitHub Apps built with Golang

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

https://martinheinz.dev/blog/65

Programming language: Go
License: MIT License

Template for GitHub Apps built with Golang alternatives and similar packages

Based on the "Continuous Integration" category.
Alternatively, view go-github-app alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of Template for GitHub Apps built with Golang or a related project?

Add another 'Continuous Integration' Package

README

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:

Building GitHub Apps with Golang

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