Skip to content

fix: errors running the test #686

fix: errors running the test

fix: errors running the test #686

name: Fix django migrations
on:
pull_request:
branches:
- main
jobs:
fix-migrations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.7.x'
cache: 'pip'
cache-dependency-path: '**/requirements.txt'
- name: Install dependencies
run: |
make install-test
- name: Run django-migration-fixer
uses: tj-django/django-migration-fixer@v1.3.6
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v19
id: verify-changed-files
with:
files: |
sample/migrations
sample_assignment/migrations
sample_driver/migrations
sample_company/migrations
- name: Commit migration changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add sample/migrations sample_assignment/migrations sample_driver/migrations sample_company/migrations
git commit -m "Update migrations"
- name: Push migration changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PAT_TOKEN }}
branch: ${{ github.head_ref }}