Skip to content

Commit e11e2bc

Browse files
committed
feat(ci): Block migrations in stable branches
Signed-off-by: Louis Chmn <louis@chmn.me>
1 parent 85882be commit e11e2bc

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: MIT
3+
4+
name: Block migrations on stable branches
5+
6+
on:
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
pull-requests: read
12+
13+
concurrency:
14+
group: block-stable-migrations-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
changes:
19+
# Only run on stableXX branches
20+
if: startsWith(github.base_ref, 'stable')
21+
runs-on: ubuntu-latest-low
22+
outputs:
23+
migrations: ${{ steps.changes.outputs.migrations }}
24+
migrations_files: ${{ steps.changes.outputs.migrations_files }}
25+
steps:
26+
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
27+
id: changes
28+
continue-on-error: true
29+
with:
30+
list-files: shell
31+
filters: |
32+
migrations:
33+
- added: 'core/Migrations/Version*.php'
34+
- added: '**/lib/Migration/Version*.php'
35+
36+
summary:
37+
permissions:
38+
contents: none
39+
runs-on: ubuntu-latest-low
40+
needs: changes
41+
42+
if: always()
43+
44+
name: block-stable-migrations-summary
45+
46+
steps:
47+
- name: Summary status
48+
if: startsWith(github.base_ref, 'stable') && needs.changes.outputs.migrations != 'false'
49+
env:
50+
MIGRATIONS: ${{ needs.changes.outputs.migrations_files }}
51+
run: |
52+
echo "Migrations must not be added to $GITHUB_BASE_REF:"
53+
echo "${MIGRATIONS:-could not determine the changed files}"
54+
exit 1

0 commit comments

Comments
 (0)