mirror of
https://github.com/nicklockwood/SwiftFormat.git
synced 2026-05-17 10:30:35 +00:00
c0b2441381
Co-authored-by: calda <1811727+calda@users.noreply.github.com>
33 lines
857 B
YAML
33 lines
857 B
YAML
name: "validate"
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, edited, synchronize, reopened]
|
|
|
|
jobs:
|
|
check-pr-base:
|
|
name: "Pull request base is 'develop'"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Fail if PR base is not 'develop'
|
|
if: github.event.pull_request.base.ref != 'develop'
|
|
run: |
|
|
echo "❌ Pull request must target the 'develop' branch. Current base: '${{ github.event.pull_request.base.ref }}'"
|
|
exit 1
|
|
|
|
check-for-changes:
|
|
runs-on: ubuntu-latest
|
|
if: github.event.pull_request.changed_files > 0
|
|
steps:
|
|
- run: echo "PR has changes, proceeding with lint"
|
|
|
|
lint:
|
|
name: "Lint"
|
|
needs: check-for-changes
|
|
runs-on: macos-15
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
- name: Lint
|
|
run: CommandLineTool/swiftformat . --cache ignore --lint
|