Skip to content

Commit b4c45b1

Browse files
Remove prevent-migration-deletion from build-and-publish job (#464)
1 parent 0bf0913 commit b4c45b1

2 files changed

Lines changed: 21 additions & 17 deletions

File tree

.github/workflows/check-build-deploy.yaml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -101,22 +101,6 @@ jobs:
101101
- name: Run pre-commit
102102
run: uv run -- pre-commit run --all-files --hook-stage manual # TODO: Add GitHub workflows output format
103103

104-
prevent-migrations-deletion:
105-
runs-on: ubuntu-latest
106-
107-
permissions:
108-
pull-requests: read
109-
110-
if: github.event_name == 'pull_request'
111-
112-
steps:
113-
- name: Prevent migrations files changing
114-
uses: CSSUoB/action-prevent-file-change@v1.7.0
115-
with:
116-
githubToken: ${{ secrets.GITHUB_TOKEN }}
117-
pattern: '.*\/db\/.+\/migrations\/\d{4}\w*\.py$'
118-
allowNewFiles: true
119-
120104
pymarkdown:
121105
runs-on: ubuntu-latest
122106
env:
@@ -222,7 +206,7 @@ jobs:
222206
github.event.pull_request.head.repo.full_name == 'CSSUoB/TeX-Bot-Py-V2'
223207
runs-on: ubuntu-latest
224208
environment: publish
225-
needs: [mypy, pre-commit, prevent-migrations-deletion, pymarkdown, pytest, ruff-lint, uv-check]
209+
needs: [mypy, pre-commit, pymarkdown, pytest, ruff-lint, uv-check]
226210
permissions:
227211
contents: read
228212
packages: write
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Prevent deletion of database migration files
2+
3+
on:
4+
pull_request_target:
5+
branches: [main]
6+
7+
jobs:
8+
prevent-migrations-deletion:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
pull-requests: read
13+
14+
steps:
15+
- name: Prevent migrations files being changed or deleted
16+
uses: xalvarez/prevent-file-change-action@v2.0.0
17+
with:
18+
githubToken: ${{ secrets.GITHUB_TOKEN }}
19+
pattern: '.*\/db\/.+\/migrations\/\d{4}\w*\.py$'
20+
allowNewFiles: true

0 commit comments

Comments
 (0)