To maintain high-fidelity automation and adhere to UDX engineering standards (CDE), follow these guidelines when designing and implementing reusable workflows.
- Access Repo Files: Only use
actions/checkoutwhen the workflow specifically needs to access repository source files (e.g., for building, linting, or reading apackage.json). - Avoid Redundant Checkouts: If a job only processes downloaded artifacts or metadata, skip
actions/checkoutto save time and resources.
- Composite Actions: Prefer using existing composite actions over manual software installation (
apt-get,curl | bash) to ensure deterministic environments. - UDX Worker Images: To execute tasks in containers, use UDX worker images. These provide a pre-configured, secure environment tailored for our CI/CD pipelines.
- Easy Deployment: Worker images are designed for easy deployment via YAML, reducing boilerplate in workflow definitions.
- Workload Identity (OIDC): Always prioritize Workload Identity Federation to configure keyless authentication. Avoid the use of static JSON keys or long-lived secrets whenever the provider supports OIDC (e.g., GCP, Azure, npm).
- Minimal Permissions: Use the
permissions:block at the job or workflow level to grant only the necessary scopes (e.g.,contents: read,id-token: write).
- Contract-First: Explicitly define all
inputsandsecretsin theworkflow_calltrigger. - Documentation: Every workflow must have a corresponding
.mdfile indocs/workflows/and a functional example inexamples/. - Validation: Use
actions/github-scriptor native workflow primitives for API checks and logic instead of relying on external CLI tools likeghwhen possible, to minimize environment dependencies.
The internal workflow .github/workflows/_release.yml automates tags and GitHub releases for this repository.
- Push to
master: Triggers an automatic stable release. - Manual (
workflow_dispatch): Allows manual releases for non-masterrefs (e.g., feature branches or hotfixes). - Validation: Manual releases targeting
masterare blocked to enforce the "Push to master" stable release policy.
- Automatic Versioning: Managed via GitVersion (
ci/git-version.yml). Tags are normalized tov<semver>. - Branch Rules:
masterincrementsMinor, while other branches incrementPatch. - Automated Changelog: Generated from git commit history between the previous release tag and the target commit (excluding merge commits).
UDX DevSecOps Team