chore(deps): bump the npm_and_yarn group across 3 directories with 4 updates #19
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Validate Version | |
| on: | |
| pull_request: | |
| paths: | |
| - "engine/pyproject.toml" | |
| - "desktop/package.json" | |
| - "website/package.json" | |
| - "vscode-extension/package.json" | |
| - "orchestration/packages/@codeflow/utils/package.json" | |
| - ".github/workflows/validate-version.yml" | |
| push: | |
| branches: | |
| - master | |
| - develop | |
| paths: | |
| - "engine/pyproject.toml" | |
| - "desktop/package.json" | |
| - "website/package.json" | |
| - "vscode-extension/package.json" | |
| - "orchestration/packages/@codeflow/utils/package.json" | |
| jobs: | |
| validate-version: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Validate version format | |
| run: | | |
| python <<'PY' | |
| import re | |
| import sys | |
| with open('engine/pyproject.toml', 'r', encoding='utf-8') as f: | |
| content = f.read() | |
| match = re.search(r'version\s*=\s*"([^"]+)"', content) | |
| if not match: | |
| print('❌ Could not find version in engine/pyproject.toml') | |
| sys.exit(1) | |
| version = match.group(1) | |
| print(f'Found version: {version}') | |
| if not re.match(r'^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$', version): | |
| print(f'❌ Invalid version format: {version}') | |
| print('Expected format: MAJOR.MINOR.PATCH[-PRERELEASE][+BUILD]') | |
| sys.exit(1) | |
| print(f'✅ Version format is valid: {version}') | |
| PY | |
| - name: Check version increment (on PR) | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| python <<'PY' | |
| import re | |
| import subprocess | |
| import sys | |
| result = subprocess.run( | |
| ['git', 'show', 'origin/master:engine/pyproject.toml'], | |
| capture_output=True, | |
| text=True, | |
| check=False, | |
| ) | |
| if result.returncode != 0: | |
| print('⚠️ Could not compare with master branch (may be first commit)') | |
| sys.exit(0) | |
| base_content = result.stdout | |
| base_match = re.search(r'version\s*=\s*"([^"]+)"', base_content) | |
| if not base_match: | |
| print('⚠️ Could not find version in base branch') | |
| sys.exit(0) | |
| with open('engine/pyproject.toml', 'r', encoding='utf-8') as f: | |
| content = f.read() | |
| current_match = re.search(r'version\s*=\s*"([^"]+)"', content) | |
| if not current_match: | |
| print('❌ Could not find version in current engine/pyproject.toml') | |
| sys.exit(1) | |
| base_version = base_match.group(1) | |
| current_version = current_match.group(1) | |
| print(f'Base version: {base_version}') | |
| print(f'Current version: {current_version}') | |
| if base_version == current_version: | |
| print('⚠️ Version has not been incremented') | |
| print('Please bump the version before merging') | |
| else: | |
| print(f'✅ Version incremented: {base_version} → {current_version}') | |
| PY | |
| - name: Validate version consistency | |
| run: | | |
| python -c " | |
| import json | |
| import re | |
| import sys | |
| files = [ | |
| 'desktop/package.json', | |
| 'website/package.json', | |
| 'vscode-extension/package.json', | |
| 'orchestration/packages/@codeflow/utils/package.json', | |
| ] | |
| with open('engine/pyproject.toml', 'r', encoding='utf-8') as f: | |
| pyproject_content = f.read() | |
| pyproject_match = re.search(r'version\s*=\s*\"([^\"]+)\"', pyproject_content) | |
| pyproject_version = pyproject_match.group(1) if pyproject_match else None | |
| for path in files: | |
| try: | |
| with open(path, 'r', encoding='utf-8') as f: | |
| package_json = json.load(f) | |
| package_version = package_json.get('version') | |
| if package_version: | |
| print(f'ℹ️ {path}: {package_version}') | |
| except FileNotFoundError: | |
| continue | |
| if pyproject_version: | |
| print(f'ℹ️ engine/pyproject.toml: {pyproject_version}') | |
| " |