Reusing workflows avoids duplication. This makes workflows easier to maintain and allows you to create new workflows more quickly by building on the work of others, just as you do with actions.
Workflow reuse also promotes best practices by helping you use well-designed, tested, and proven effective workflows. Your organization can build up a library of reusable workflows that can be centrally maintained.
Rather than copying and pasting from one workflow to another, you can make workflows reusable. You and anyone with access to the reusable workflow can then call the reusable workflow from another workflow.
- Approve or reject jobs awaiting review
- Dependencies cache
- Job summaries
- OpenID connect in Google Cloud Platform
- OpenTofu state and plan encryption
You can check the .github/workflows directory for example configurations:
These set up the system for the testing process by providing all the necessary initial code, thus creating good examples to base your configuration on.
Since we use early variable evaluation for backend and provider configuration, consumers must ensure that the following variables are set in each respective variables.tofu file:
# These three state_* variables are required for early variable evaluation for backend and provider configuration.
# They are defined in the GitHub Actions called workflows and should NOT be set in the OpenTofu configuration.
variable "state_bucket" {
description = "The name of the GCS bucket to store state files"
type = string
}
variable "state_kms_encryption_key" {
description = "The KMS encryption key for state and plan files"
type = string
}
variable "state_prefix" {
description = "The prefix for state files in the GCS bucket"
type = string
}