Add CI check to bump version on lint changes #1
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: Enforce Major Version for lint changes | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled, unlabeled] | |
| paths: | |
| - 'pkgs/lints/lib/**.yaml' | |
| jobs: | |
| check-major-version: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Verify Major first in major version is X.0.0 or X.0.0-wip | |
| if: "!contains(github.event.pull_request.labels.*.name, 'skip-breaking-check')" | |
| working-directory: pkgs/lints | |
| run: | | |
| # 1. extract version from pubspec.yaml | |
| VERSION=$(grep '^version:' pubspec.yaml | awk '{print $2}') | |
| echo "Checking version: $VERSION" | |
| # 2. Assert format is X.0.0 or X.0.0-wip | |
| if [[ ! "$VERSION" =~ ^[0-9]+\.0\.0(-wip)?$ ]]; then | |
| echo "::error::Changes to lints require a major version bump." | |
| echo "To bypass, add the 'skip-breaking-check' label." | |
| exit 1 | |
| fi |