githubactions-golang Plugin
This plugin depends on the following environment variable:
- GITHUB_TOKEN
Set it before using this plugin.
If Docker image build/push is enabled (see the example below), you also need to set the following two environment variables: - DOCKERHUB_USERNAME - DOCKERHUB_TOKEN
Some parameters are optional. See the default values and optional parameters in the example above.
Use Together with the github-repo-scaffolding-golang
Plugin
For example, you can first use github-repo-scaffolding-golang
to bootstrap a Golang repo, then use this plugin to set up basic GitHub Actions CI workflows. In this scenario:
- This plugin can specify
github-repo-scaffolding-golang
as a dependency, so that the dependency is first satisfied before executing this plugin. - This plugin can refer to
github-repo-scaffolding-golang
‘s output to reduce copy/paste human error.
See the example below:
---
tools:
- name: github-repo-scaffolding-golang
instanceID: default
options:
owner: IronCore864
repo: go-webapp-devstream-demo
- name: githubactions-golang
instanceID: default
dependsOn: ["github-repo-scaffolding-golang.default"]
options:
owner: ${{github-repo-scaffolding-golang.default.outputs.owner}}
repo: ${{github-repo-scaffolding-golang.default.outputs.repo}}
language:
name: go
version: "1.17"
branch: main
build:
test:
coverage:
enable: True
docker:
enable: True
registry:
type: dockerhub
username: [[ dockerhubUsername ]]
repository: ${{github-repo-scaffolding-golang.default.outputs.repo}}
- We put
ggithub-repo-scaffolding-golang.default
as dependency by using thedependsOn
keyword. - We used
github-repo-scaffolding-golang.default
‘s output as input for thegithubactions-golang
plugin.
Pay attention to the ${{ xxx }}
part in the example. is the syntax for using an output.