Design CI/CD workflows with reusability and clear naming conventions from the start. Use meaningful prefixes that reflect the conceptual purpose (like "trunk" for trunk-based development), and consider future extraction into standalone, parameterized actions when similar functionality might be needed across repositories.
Design CI/CD workflows with reusability and clear naming conventions from the start. Use meaningful prefixes that reflect the conceptual purpose (like “trunk” for trunk-based development), and consider future extraction into standalone, parameterized actions when similar functionality might be needed across repositories.
For workflow implementation:
Example:
name: reusable-build-workflow
on:
workflow_call:
inputs:
commit_sha:
description: 'Commit SHA to build (leave empty for current HEAD)'
required: false
type: string
prefix:
description: 'Tag prefix to use (e.g. trunk)'
required: true
type: string
jobs:
build:
steps:
- name: Set variables
id: vars
run: |
COMMIT_SHA="$"
echo "tag_name=$/${COMMIT_SHA}" >> $GITHUB_OUTPUT
# For package installation, use consistent approach with explicit flags
- name: Install dependencies
run: pip install cmake --force-reinstall
This approach makes workflows more maintainable and enables cross-repository sharing of common CI/CD patterns.
Enter the URL of a public GitHub repository