{"repo":"sethvargo/go-githubactions","free":true,"listed":false,"github":"https://github.com/sethvargo/go-githubactions","clone":"git clone https://github.com/sethvargo/go-githubactions.git","description":"Go SDK for GitHub Actions - easily author GitHub Actions in Go","language":"Go","stars":520,"topics":["github-actions","github-actions-docker","golang","actions-sdk","actions-sdk-go"],"license":"Apache-2.0","category":"api-integrations-sdks","readme_excerpt":"GitHub Actions SDK (Go) This library provides an SDK for authoring [GitHub Actions][gh-actions] in Go. It has no external dependencies and provides a Go-like interface for interacting with GitHub Actions' build system. Installation Download the library: Usage The easiest way to use the library is by importing it and invoking the functions at the root: You can also create an instance with custom fields that will be included in log messages: For more examples and API documentation, please see the [Go docs][godoc]. Publishing There are multiple ways to publish GitHub Actions written in Go: - Composite actions - Pre-compiled binaries with a shim - Docker containers (see below) By default, GitHub Actions expects actions to be written in Node.js. For other languages like Go, you need to provide a Dockerfile and entrypoint instructions in an action.yml file: And then users can import your action by the repository name: However, this will clone the entire repo and compile the Go code each time the action runs. Worse, it uses the Go base container which is a few hundred MBs and includes a ton of unnecessary things. Fortunately, GitHub Actions can also source from a Docker container directly from Docker Hub: Now we can precompile and publish our Go Action as a Docker container, but we need to make it much, much smaller first. This can be achieved using multi-stage Docker builds: The first step, uses a fat container to build, strip, and compress the compiled Go binary. Then, in the seco","default_branch":null,"files":null,"tree":[],"storefront":"/r/sethvargo","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/sethvargo/go-githubactions/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}