From 3f99c58959904a665e19f2dbd290f105f116e369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Barr=C3=A9?= Date: Thu, 5 Mar 2026 15:49:06 -0500 Subject: [PATCH 1/2] Detect breaking changes --- .github/workflows/no-breaking-changes.yml | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/no-breaking-changes.yml diff --git a/.github/workflows/no-breaking-changes.yml b/.github/workflows/no-breaking-changes.yml new file mode 100644 index 0000000..9de2178 --- /dev/null +++ b/.github/workflows/no-breaking-changes.yml @@ -0,0 +1,34 @@ +name: No breaking changes + +on: + pull_request: + branches: ["main"] + paths: [".workleap.rules.yaml"] + +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." From 58f9e4d6d1c91821166c3b14a9e0220915d3a345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Barr=C3=A9?= Date: Thu, 5 Mar 2026 15:50:40 -0500 Subject: [PATCH 2/2] wip --- .github/workflows/no-breaking-changes.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/no-breaking-changes.yml b/.github/workflows/no-breaking-changes.yml index 9de2178..f575d39 100644 --- a/.github/workflows/no-breaking-changes.yml +++ b/.github/workflows/no-breaking-changes.yml @@ -5,6 +5,9 @@ on: branches: ["main"] paths: [".workleap.rules.yaml"] +permissions: + contents: read + jobs: check-no-removed-rules: runs-on: ubuntu-latest