This directory contains TypeScript scripts used by the reusable workflows in this repository.
Detects which VS Code extensions have changed since their last release and determines the appropriate version bump type.
Features:
- Discovers all VS Code extensions in the
packages/directory (packages with apublisherfield) - Supports special values for extension selection:
'all'- selects all available extensions'changed'- detects extensions with changes via git diff against per-extension tags'none'- skips all extensions- Specific names - validates and uses the specified extensions
- Git-based change detection:
- Finds last release tag per extension (pattern:
{extension-name}-v{version}) - Runs
git diff {lastTag}..HEAD -- {extensionPath} - Returns extensions with changes since their last tag
- Finds last release tag per extension (pattern:
- Conventional commit analysis for
version-bump: 'auto':- Detects
BREAKING CHANGE→ major bump - Detects
feat:→ minor bump - Default → patch bump
- Detects
Usage in workflows:
- name: Detect changes and version bumps
id: changes
env:
IS_NIGHTLY: 'true'
VERSION_BUMP: 'auto'
PRE_RELEASE: 'true'
IS_PROMOTION: 'false'
SELECTED_EXTENSIONS: 'changed' # or 'all', 'none', or comma-separated names
run: |
npx tsx .github/scripts/index.ts ext-change-detectorOutputs:
selected-extensions- Comma-separated list of extensions to releaseversion-bumps- Determined version bump type (major, minor, patch)
The scripts require the following npm packages:
simple-git- Git operationschalk- Terminal output formattingsemver- Semantic version parsing and comparisonzod- Schema validationtsx- TypeScript execution
Install dependencies:
npm installRun a script:
npm run ext-change-detectorOr directly with tsx:
npx tsx .github/scripts/index.ts ext-change-detectorThese scripts are automatically downloaded and executed by the reusable workflows in this repository. Consuming repositories do not need to copy these scripts - they are fetched at runtime from the main branch of this repository.
The vscode-publish-extensions.yml workflow automatically:
- Downloads the scripts from GitHub
- Installs required dependencies
- Executes the change detection
- Uses the outputs to determine which extensions to publish