Skip to content
3warePublic

About

Reusable workflow repository

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

256 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

3ware reusable workflows

GitHub release issues - workflows CI

Contains GitHub Action reusable workflows and composite actions that can be consumed by other repositories.

Table of contents

Reusable Workflows

Pull Request Title Validation

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.

Inputs

  • scopes (optional) Newline delimited list of commit scopes. Defaults to empty.

Secrets

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)

Permissions

  • contents: read
  • pull-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 }}

Trunk Code Quality

Runs trunk code quality, configured via the .trunk/trunk.yaml configuration file, on changes made via pull requests.

Inputs

  • persist-credentials (optional). Defaults to false.

Secrets

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)

Permissions

  • 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 }}

Composite Actions

Trunk tofu init

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.

Inputs

  • tofu-version (required)
  • dir-max-depth (optional, default 3)
  • iac-dir-path (optional, default iac)

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

Tip

For ease of configuration follow the recommended IaC project folder structure below

Recommended Folder Structure

iac
├── environments
└── modules
    ├── module1
    └── module2

About

Reusable workflow repository

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors