From ecc49a08075f3b600d090c42bd76957e3543b26c Mon Sep 17 00:00:00 2001 From: Conrad Date: Tue, 6 Oct 2020 17:04:33 +0200 Subject: [PATCH 1/2] Updated documentation + Adjusted default commit_message --- README.md | 14 ++++++++------ action.yml | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 98f92c8..3d376bb 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,14 @@ A GitHub action for drawing a Django data model automatically. ### Parameters -| Parameter | Required | Default | Description | -| -------------- | :------: | :---------------: | ---------------------------------------- | -| commit_message | :x: | Added data schema | Custom git commit message | -| output_path | :x: | . | Output path for generated files | -| pip_path | :x: | requirements.txt | Requirements path for the Django project | -| project_path | :x: | ./ | The path to manage.py | +| Parameter | Required | Default | Description | +| -------------- | :------: | :-----------------: | ------------------------------------------------------------------ | +| commit_message | :x: | Updated data schema | Custom git commit message | +| output_path | :x: | . | Output path for generated files (see 'Example Config' for example) | +| pip_path | :x: | requirements.txt | Requirements path for the Django project | +| project_path | :x: | ./ | The path to manage.py (see 'Example Config' for example) | + +> Note: The output_path has to exist already. ### Example Config diff --git a/action.yml b/action.yml index e0f69a8..8855c39 100644 --- a/action.yml +++ b/action.yml @@ -7,7 +7,7 @@ inputs: commit_message: description: Commit message of the changed data required: false - default: "Added data schema" + default: "Updated data schema" pip_path: description: Path relative to the repository root, where the requirements.txt is located required: false From 24f2748d1e907f38d1d529abf0b2a4aa60a97be5 Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 11 Jul 2022 13:38:45 +0200 Subject: [PATCH 2/2] Tried adjusting git status --- entrypoint.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 71c8e5e..b01c5c6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -20,20 +20,15 @@ EOF git config --global user.name "GitHub Action" } -# Checks if any files are changed -_git_changed() { - [[ -n "$(git status -s)" ]] -} - -# PROGRAM echo "Installing dependencies..." pip3 install --no-cache-dir -r $INPUT_PIP_PATH + echo "Creating data model..." cd $INPUT_PROJECT_PATH python3 manage.py graph_models -a -g -o $INPUT_OUTPUT_PATH # To keep runtime good, just continue if something was changed -if _git_changed; +if [[ `$(git status -s)` ]]; then # Calling method to configure the git environemnt _git_setup