Add dependency-locking flags to inline Swift and xcodebuild commands in Azure Pipelines YAML so CI uses checked-in package resolution data instead of resolving packages opportunistically.
Installation
bash
# Install from registry
codemod run @codemod/azure-pipelines-lock-swift-deps
# Or run locally
codemod run -w workflow.yaml
Usage
This codemod rewrites Azure Pipelines YAML command values under script, bash, and pwsh keys.
swift build ... -> swift build --disable-automatic-resolution ...
swift test ... -> swift test --disable-automatic-resolution ...
xcodebuild ... build|test|archive|analyze -> inserts both -disableAutomaticPackageResolution and -onlyUsePackageVersionsFromResolvedFile
xcodebuild -resolvePackageDependencies ... -> inserts the same two xcodebuild flags
Preserve cases:
Commands that already include the lock flags stay unchanged
# Test the transformation
pnpm test
# Validate the workflow
codemod workflow validate -w workflow.yaml
# Publish to registry
codemod login
codemod publish
License
MIT
Ready to evolve your codebase?
Build tailored, compiler-aware skills to assess, plan, and automate complex codebase changes.