-
Notifications
You must be signed in to change notification settings - Fork 5
/
action.yml
41 lines (36 loc) · 1.18 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: django-migration-fixer
description: Resolve django makemigrations multiple leaf nodes in the migration graph error
author: tj-actions
inputs:
managepy-path:
description: 'The location of manage.py.'
required: true
default: './manage.py'
default-branch:
description: 'The default branch or target branch of a Pull request: Defaults to github.base_ref'
required: false
default: ${{ github.base_ref }}
force-update:
description: 'Force update the target branch locally when git fetch fails.'
required: false
skip-default-branch-update:
description: 'Skip pulling the latest changes from the default branch.'
required: false
runs:
using: 'composite'
steps:
- id: migration-fixer
run: |
DEFAULT_BRANCH="${{ inputs.default-branch }}"
EXTRA_ARGS="--fix"
if [[ '${{ inputs.force-update }}' == 'true' ]]; then
EXTRA_ARGS+=" -f"
fi
if [[ '${{ inputs.skip-default-branch-update }}' == 'true' ]]; then
EXTRA_ARGS+=" -s"
fi
python ${{ inputs.managepy-path }} makemigrations $EXTRA_ARGS -b "${DEFAULT_BRANCH}"
shell: bash
branding:
icon: check
color: white