Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/no-breaking-changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: No breaking changes

on:
pull_request:
branches: ["main"]
paths: [".workleap.rules.yaml"]

permissions:
contents: read

jobs:
check-no-removed-rules:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get base branch rules
run: |
git fetch origin ${{ github.base_ref }}
git show origin/${{ github.base_ref }}:.workleap.rules.yaml > /tmp/base-rules.yaml

- name: Check for removed rules
shell: pwsh
run: |
Install-Module -Name powershell-yaml -Force -Scope CurrentUser

$baseRules = (Get-Content /tmp/base-rules.yaml -Raw | ConvertFrom-Yaml).rules.Keys
$currentRules = (Get-Content .workleap.rules.yaml -Raw | ConvertFrom-Yaml).rules.Keys

$removed = $baseRules | Where-Object { $_ -notin $currentRules }

if ($removed) {
Write-Error "The following rules were removed, which is a breaking change:`n$($removed -join "`n")"
exit 1
}

Write-Host "No rules were removed."