Merge pull request #6 from noah-software/dev

Updated documentation + Adjusted default commit_message
This commit is contained in:
2022-09-21 14:57:35 +02:00
committed by GitHub
3 changed files with 11 additions and 8 deletions

View File

@@ -6,12 +6,14 @@ A GitHub action for drawing a Django data model automatically.
### Parameters ### Parameters
| Parameter | Required | Default | Description | | Parameter | Required | Default | Description |
| -------------- | :------: | :---------------: | ---------------------------------------- | | -------------- | :------: | :-----------------: | ------------------------------------------------------------------ |
| commit_message | :x: | Added data schema | Custom git commit message | | commit_message | :x: | Updated data schema | Custom git commit message |
| output_path | :x: | . | Output path for generated files | | output_path | :x: | . | Output path for generated files (see 'Example Config' for example) |
| pip_path | :x: | requirements.txt | Requirements path for the Django project | | pip_path | :x: | requirements.txt | Requirements path for the Django project |
| project_path | :x: | ./ | The path to manage.py | | project_path | :x: | ./ | The path to manage.py (see 'Example Config' for example) |
> Note: The output_path has to exist already.
### Example Config ### Example Config

View File

@@ -7,7 +7,7 @@ inputs:
commit_message: commit_message:
description: Commit message of the changed data description: Commit message of the changed data
required: false required: false
default: "Added data schema" default: "Updated data schema"
pip_path: pip_path:
description: Path relative to the repository root, where the requirements.txt is located description: Path relative to the repository root, where the requirements.txt is located
required: false required: false

3
entrypoint.sh Executable file → Normal file
View File

@@ -12,13 +12,14 @@ _git_setup ( ) {
echo "Installing dependencies..." echo "Installing dependencies..."
pip3 install -U pip wheel pygraphviz pip3 install -U pip wheel pygraphviz
pip3 install -r "$INPUT_PIP_PATH" pip3 install --no-cache-dir -r "$INPUT_PIP_PATH"
echo "Creating data model..." echo "Creating data model..."
cd "$INPUT_PROJECT_PATH" cd "$INPUT_PROJECT_PATH"
python3 manage.py graph_models -a -g -o "$INPUT_OUTPUT_PATH" python3 manage.py graph_models -a -g -o "$INPUT_OUTPUT_PATH"
# To keep runtime good, just continue if something was changed # To keep runtime good, just continue if something was changed
if [[ `git status --porcelain` ]]; then if [[ `git status --porcelain` ]]; then
# Calling method to configure the git environemnt # Calling method to configure the git environemnt
_git_setup _git_setup