Skip to content

Create the moderation decision model #48

Create the moderation decision model

Create the moderation decision model #48

name: "Migration Safety Check"
on:
pull_request:
paths:
- "**/migrations/**/*"
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests.
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
check-and-apply-labels:
name: "Check and Apply Labels"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: peter-evans/find-comment@v3
id: existing-warning
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: This PR has migrations
- name: Delete existing migration warning comment
uses: actions/github-script@v7
if: steps.existing-warning.outputs.comment-id != 0
with:
github-token: ${{ secrets.ACCESS_TOKEN }}
script: |
await github.rest.issues.deleteComment({
owner: 'WordPress',
repo: 'openverse',
comment_id: ${{ steps.existing-warning.outputs.comment-id }},
})
- uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
This PR has migrations. Please rebase it before merging to ensure that conflicting migrations are not introduced.
- uses: banyan/auto-label@1.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}