Contains GitHub Action reusable workflows and composite actions that can be consumed by other repositories.
Table of contents
Validate the pull request title conforms to the conventional commit specification. This is important because all changes must be made through pull requests. Commits are squashed when the pull request is merged and the pull request title is used as the commit message. Accurate release notes and version tags can be generated when commits follow the spec.
scopes(optional) Newline delimited list of commit scopes. Defaults to empty.
GitHub App, with contents:write permission, required to trigger a check run when an incorrect pull request title is corrected.
threeware-bot-app-id(required)threeware-bot-private-key(required)
contents: readpull-requests: write
Warning
Do not define a workflow-level concurrency group in the calling workflow. The reusable workflow already defines a job-level group per pull request.
name: Example PR Workflow
on:
pull_request:
types: [opened, edited, reopened, synchronize]
branches: [main]
permissions: {}
jobs:
validate-pr-title:
name: Validate PR Title
permissions:
contents: read
pull-requests: write
uses: 3ware/workflows/.github/workflows/reusable-validate-pr-title.yaml@v5.0.0
with:
scopes: |
build
deps
secrets:
threeware-bot-app-id: ${{ secrets.threeware_BOT_APP_ID }}
threeware-bot-private-key: ${{ secrets.threeware_BOT_PRIVATE_KEY }}Runs trunk code quality, configured via the .trunk/trunk.yaml configuration file, on changes made via pull requests.
persist-credentials(optional). Defaults tofalse.
GitHub App, which creates an organisation token for specific repositories, that allows zizmor to run in online mode.
threeware-bot-app-id(required)threeware-bot-private-key(required)
contents: read
Warning
Do not define a workflow-level concurrency group in the calling workflow. The reusable workflow already cancels superseded runs on the same pull request; a matching caller group can cause the run to be cancelled as a deadlock.
name: Example Lint Workflow
on:
pull_request:
types: [opened, reopened, synchronize]
branches: [main]
# Disable permissions for all available scopes
permissions: {}
jobs:
trunk:
name: Trunk Code Quality
permissions:
contents: read
uses: 3ware/workflows/.github/workflows/reusable-trunk-code-quality.yaml@v5.0.0
secrets:
threeware-bot-app-id: ${{ secrets.threeware_BOT_APP_ID }}
threeware-bot-private-key: ${{ secrets.threeware_BOT_PRIVATE_KEY }}Trunk's action uses a composite action defined in setup-ci to prepare a workspace if necessary before any linters are run. Trunk is used to fmt, validate and tflint Infrastructure-as-Code projects. These tools require the IaC directory to be initialised with tofu init. The purpose of trunk-tofu-init is to detect file modification within IaC directories and initialise them prior to running trunk check.
When the IS_TRUNK_UPGRADE or INIT_ALL_MODULES environment variable is true, every directory containing .tf files is initialised instead of only the changed ones.
tofu-version(required)dir-max-depth(optional, default3)iac-dir-path(optional, defaultiac)
Define the following workflow in .trunk/setup-ci/action.yaml:
name: Trunk Code Quality Setup
description: Set up dependencies for Trunk Code Quality
runs:
using: composite
steps:
- name: Initialise OpenTofu Directories
uses: 3ware/workflows/.github/actions/trunk-tofu-init@v5.0.0
with:
tofu-version: 1.13.0Tip
For ease of configuration follow the recommended IaC project folder structure below
iac
├── environments
└── modules
├── module1
└── module2