composite-action-framework-go

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2025 License: MPL-2.0

README

Composite Action Framework Go

A library of packages for writing composite GitHub Actions in Go.


This is intended for internal HashiCorp use only and is not generally supported for other users.


This is different from other Go GitHub Actions libraries which are focussed on writing standalone actions that just run a go binary and then exit.

Why Composite Actions?

Composite actions allow the composition of multiple other actions as well as arbitrary build steps together in a single action. This means that composite actions have the full actions ecosystem available.

Composite actions can also present some challenges:

  • Need to be able to run discrete chunks of logic in separate steps.
  • Need to be able to share configuration and calculated values between steps.
  • When complex logic is involved, need to be able to test it and share it with other codebases.

The Implied Strategy

This framework is intended to help you to write Go-based composite actions by implementing a CLI to do the heavy lifting, and embedding calls to that CLI in the action.yml.

The CLI package ./pkg/cli is designed so that each defined command is able to act as the entire CLI, or is able to be embedded in another similar CLI and become a subcommand there.

This means that functionality written to support an action can be embedded inside other tools, to be run locally, for instance.

Directories

Path Synopsis
pkg
cli
fs
git
testhelpers/goldenfile
Package goldenfile allows you to assert that a function that generates a file generates the exact file you expect.
Package goldenfile allows you to assert that a function that generates a file generates the exact file you expect.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL