Hardcoded configuration values scattered throughout codebases create maintenance burdens and increase the risk of inconsistency. Define configuration values (like versions, paths, and feature flags) in a single location and reference them elsewhere.
For build systems and CI workflows:
Example:
# GOOD: Define version at the top level
env:
ZIG_VERSION: "0.13.0"
jobs:
build:
steps:
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: $
test:
steps:
- name: Build with Zig
run: zig-${ZIG_VERSION} build test
This approach makes version updates simpler, reduces errors from inconsistent values, and makes configuration more maintainable. For complex configurations, consider creating a dedicated configuration module that can be imported by other components of the system.
Enter the URL of a public GitHub repository