Skip to content

hlvtechnologies/gha-workflows

Repository files navigation

gha-workflows

Reusable GitHub Actions workflows for OpenTofu/Terraform modules (CI, Release Please, semantic PR titles).

Consumers

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-version

Replace hlvtechnologies with your GitHub org or user if you fork this repo.

Available workflows

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).

Secrets

  • Release Please: callers must pass secrets: RELEASE_PLEASE_TOKEN (see inherit or map explicitly). Define RELEASE_PLEASE_TOKEN in the calling repository (module repos and this repo).

Versioning this repository

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.

  1. Add the RELEASE_PLEASE_TOKEN repository 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).
  2. Merge conventional commits (feat:, fix:, etc.); Release Please opens a release PR; merge it to publish a GitHub Release and tag vX.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:

  1. Merge to main.
  2. git tag v1.x.y && git push origin v1.x.y
  3. Update uses: ...@v1.x.y in downstream repos as needed.

License

See LICENSE.

About

Github Actions Reusable Workflows

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors