Skip to content

Migrations reminder

Migrations reminder #4

# GitHub action that checks if the PR contains changes related to migrations an add reminder comment to the PR.
# Based on https://github.com/marketplace/actions/changed-files
name: Migrations Reminder
on:
pull_request
jobs:
reminder_comment_on_pr:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Group files that have changed
id: changed-files-yaml
uses: tj-actions/changed-files@v41
with:
files_yaml: |
linters:
- '.github/workflows/isolated_migrations.yml'
- 'src/api/.rubocop*.yml'
migrations:
- src/api/db/migrate/**
- src/api/db/schema.rb
- src/api/db/data/**
- src/api/db/data_schema.rb
not_migrations:
- '!src/api/db/migrate/**'
- '!src/api/db/schema.rb'
- '!src/api/db/data/**'
- '!src/api/db/data_schema.rb'
- '!src/api/db/attribute_descriptions.rb'
- '!src/api/db/seeds.rb'
- '!.github/workflows/isolated_migrations.yml'
- '!src/api/.rubocop*.yml'
schema_migrations:
- src/api/db/migrate/**
data_migrations:
- src/api/db/data/**
schema:
- src/api/db/schema.rb
data_schema:
- src/api/db/data_schema.rb
- name: List the files related to migrations that this PR changes
if: steps.changed-files-yaml.outputs.migrations_any_changed == 'true'
run: |
for file in ${{ steps.changed-files-yaml.outputs.migrations_all_changed_files }}; do
echo "- $file"
done
- name: comment PR
uses: khezen/cmtpr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: "Looks good to me!"