Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
18 changes: 1 addition & 17 deletions .github/workflows/check-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,22 +101,6 @@ jobs:
- name: Run pre-commit
run: uv run -- pre-commit run --all-files --hook-stage manual # TODO: Add GitHub workflows output format

prevent-migrations-deletion:
runs-on: ubuntu-latest

permissions:
pull-requests: read

if: github.event_name == 'pull_request'

steps:
- name: Prevent migrations files changing
uses: CSSUoB/action-prevent-file-change@v1.7.0
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
pattern: '.*\/db\/.+\/migrations\/\d{4}\w*\.py$'
allowNewFiles: true

pymarkdown:
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -222,7 +206,7 @@ jobs:
github.event.pull_request.head.repo.full_name == 'CSSUoB/TeX-Bot-Py-V2'
runs-on: ubuntu-latest
environment: publish
needs: [mypy, pre-commit, prevent-migrations-deletion, pymarkdown, pytest, ruff-lint, uv-check]
needs: [mypy, pre-commit, pymarkdown, pytest, ruff-lint, uv-check]
permissions:
contents: read
packages: write
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/prevent-migrations-deletion.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Prevent deletion of database migration files

on:
pull_request_target:
branches: [main]

jobs:
prevent-migrations-deletion:
runs-on: ubuntu-latest

permissions:
pull-requests: read

steps:
- name: Prevent migrations files changing
uses: xalvarez/prevent-file-change-action@v2.0.0
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
pattern: '.*\/db\/.+\/migrations\/\d{4}\w*\.py$'
allowNewFiles: true