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:

    1. ---
    2. tools:
    3. - name: github-repo-scaffolding-golang
    4. instanceID: default
    5. options:
    6. owner: IronCore864
    7. repo: go-webapp-devstream-demo
    8. - name: githubactions-golang
    9. instanceID: default
    10. dependsOn: ["github-repo-scaffolding-golang.default"]
    11. options:
    12. owner: ${{github-repo-scaffolding-golang.default.outputs.owner}}
    13. repo: ${{github-repo-scaffolding-golang.default.outputs.repo}}
    14. language:
    15. name: go
    16. version: "1.17"
    17. branch: main
    18. build:
    19. test:
    20. coverage:
    21. enable: True
    22. docker:
    23. enable: True
    24. registry:
    25. type: dockerhub
    26. username: [[ dockerhubUsername ]]
    27. repository: ${{github-repo-scaffolding-golang.default.outputs.repo}}
    • We put ggithub-repo-scaffolding-golang.default as dependency by using the dependsOn keyword.
    • We used github-repo-scaffolding-golang.default‘s output as input for the githubactions-golang plugin.

    Pay attention to the ${{ xxx }} part in the example. is the syntax for using an output.