Skip to content

Commit 459b355

Browse files
authored
Create action.yml
1 parent 3de8f6b commit 459b355

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

action.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: django-migration-fixer
2+
description: Resolve django makemigrations multiple leaf nodes in the migration graph error
3+
author: tj-actions
4+
inputs:
5+
managepy-path:
6+
description: 'The location of manage.py.'
7+
required: true
8+
default: './manage.py'
9+
default-branch:
10+
description: 'The default branch or target branch of a Pull request: Defaults to github.base_ref'
11+
required: false
12+
force-update:
13+
description: 'Force update the target branch locally when git fetch fails.'
14+
required: false
15+
16+
runs:
17+
using: 'composite'
18+
steps:
19+
- name: Get branch name
20+
id: branch-name
21+
uses: tj-actions/[email protected]
22+
- id: migration-fixer
23+
run: |
24+
pip install django-migration-fixer==1.0.0
25+
26+
EXTRA_ARGS="--fix"
27+
28+
if [[ '${{ inputs.force-update }}' == 'true' ]]; then
29+
EXTRA_ARGS+=" -f"
30+
fi
31+
32+
if [[ -z "${{ inputs.default-branch }}" ]]; then
33+
BRANCH="${{ steps.branch-name.outputs.base_ref_branch }}"
34+
fi
35+
36+
${{ inputs.managepy-path }} $EXTRA_ARGS -b "$BRANCH"
37+
shell: bash
38+
branding:
39+
icon: check
40+
color: white

0 commit comments

Comments
 (0)