Repository navigation
fix(tests): fix mypy errors in test_basic.py and reuse utils helpers #16
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: Changeset | |
| # Validate .changeset files on every commit of every PR, with the same rules | |
| # the Package Release workflow applies when it bumps versions. The reminder for | |
| # PRs without a changeset lives in changeset-reminder.yml; keeping it separate | |
| # means this workflow never reports a skipped "Validate changesets" check that | |
| # could satisfy a required status check. | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate: | |
| name: Validate changesets | |
| # renovate/* PRs are dependency/security updates and never carry changesets | |
| if: "!startsWith(github.event.pull_request.head.ref, 'renovate/')" | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Default ref is the PR merge commit, i.e. the base branch's versions plus | |
| # every changeset that would be pending once this PR merges. | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dependencies | |
| run: pip install click packaging | |
| - name: Validate changesets | |
| env: | |
| BASE_BRANCH: ${{ github.base_ref }} | |
| run: | | |
| # Only RC releases are allowed from non-main branches | |
| args=() | |
| if [ "$BASE_BRANCH" != "main" ]; then | |
| args+=(--rc-only) | |
| fi | |
| if ! out=$(python .github/changesets.py --check "${args[@]}" 2>&1); then | |
| echo "$out" | |
| echo "::error title=Invalid changeset::${out#Error: }" | |
| exit 1 | |
| fi | |
| echo "$out" |