Reusable GitHub Actions workflows for OpenTofu/Terraform modules (CI, Release Please, semantic PR titles).
Module repositories call these workflows with uses: and a pinned git ref (tag or SHA), for example:
jobs:
pre-commit:
uses: hlvtechnologies/gha-workflows/.github/workflows/opentofu-module-ci.yml@v1.1.1 # x-release-please-versionReplace hlvtechnologies with your GitHub org or user if you fork this repo.
| File | Purpose |
|---|---|
| opentofu-module-ci.yml | Python, TFLint, terraform-docs, OpenTofu from .opentofu-version, pre-commit run --all-files |
| release-please-terraform-module.yml | Release Please; semver tags — set release-type in your release-please-config.json (e.g. terraform-module for modules, simple for this repo) |
| semantic-pr-title.yml | Conventional Commit PR titles (skips Release Please labels) |
Optional workflow_call inputs are documented in each file (e.g. tofu_version_file, terraform_docs_version).
- Release Please: callers must pass
secrets: RELEASE_PLEASE_TOKEN(see inherit or map explicitly). DefineRELEASE_PLEASE_TOKENin the calling repository (module repos and this repo).
This repository uses Release Please on main with release-type: simple so tags and CHANGELOG.md follow Semantic Versioning from Conventional Commits on main.
Pull requests targeting main run semantic-pr.yml, which calls the reusable semantic-pr-title.yml so PR titles match Conventional Commits (aligned with Release Please). Release Please release PRs can use labels autorelease: pending or autorelease: tagged to skip the title check.
- Add the
RELEASE_PLEASE_TOKENrepository secret (fine-grained or classic PAT with Contents and Pull requests read/write for this repo; include Workflow if other workflows must run on release events). - Merge conventional commits (
feat:,fix:, etc.); Release Please opens a release PR; merge it to publish a GitHub Release and tagvX.Y.Z.
Downstream module repos should still pin uses: hlvtechnologies/gha-workflows/.github/workflows/....yml@vX.Y.Z to a tag (or SHA), not main, so workflow changes roll out only when you bump the ref after a Release Please release.
If you add or change reusable workflows without going through Release Please (not recommended), you can still tag manually:
- Merge to
main. git tag v1.x.y && git push origin v1.x.y- Update
uses: ...@v1.x.yin downstream repos as needed.
See LICENSE.