File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 4646$ python manage.py makemigrations -b master --fix
4747```
4848
49+
50+ ### Github Actions
51+
52+ ``` yaml
53+ ...
54+ runs-on : ubuntu-latest
55+ steps :
56+ - uses : actions/checkout@v2
57+ with :
58+ fetch-depth : 0
59+
60+ - name : Set up Python
61+ uses : actions/setup-python@v2
62+ with :
63+ python-version : ' 3.6.x'
64+
65+ - name : Upgrade pip
66+ run : |
67+ pip install -U pip
68+
69+ - name : Run django-migration-fixer
70+ 71+ with :
72+ managepy-path : /path/to/manage.py
73+
74+ - name : Verify Changed files
75+ uses :
tj-actions/[email protected] 76+ id : verify-changed-files
77+ with :
78+ files : |
79+ /path/to/migrations
80+
81+ - name : Commit migration changes
82+ if : steps.verify-changed-files.outputs.files_changed == 'true'
83+ run : |
84+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
85+ git config --local user.name "github-actions[bot]"
86+ git add /path/to/migrations
87+ git commit -m "Update migrations"
88+
89+ - name : Push migration changes
90+ if : steps.verify-changed-files.outputs.files_changed == 'true'
91+ uses : ad-m/github-push-action@master
92+ with :
93+ github_token : ${{ secrets.GITHUB_TOKEN }}
94+ branch : ${{ github.ref }}
95+ ` ` `
96+
97+
4998## Features
5099
51100* Maintain a consistent migration history when conflicts occur as a result of changes made using different versions of the default branch.
You can’t perform that action at this time.
0 commit comments