Skip to content

Commit 8a81987

Browse files
committed
Add extra arguments
- Allow extra arbitrary arguments to be added to the check command
1 parent 762dd0a commit 8a81987

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Victoria Drake
3+
Copyright (c) 2020-2021 Victoria Drake
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ env:
2121
ENV_TYPE: venv
2222
DEP_PATH: app/requirements.txt
2323
APP_PATH: app/
24+
EXTRA_ARGS: "--settings=app.settings.production"
2425

2526
jobs:
2627
build:
@@ -109,6 +110,8 @@ Set the `APP_PATH` to the location of your `manage.py` file. For example, if you
109110

110111
If you are not using a virtual environment, shame on you. This action will still try to help you by installing Django. Ensure you set `APP_PATH` to the directory of your `manage.py` file.
111112

113+
You can use `EXTRA_ARGS` to pass any additional desired arguments, such as a settings module.
114+
112115
### Workflow customization
113116

114117
See full instructions for [Configuring and managing workflows](https://help.github.com/en/actions/configuring-and-managing-workflows).

entrypoint.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
FAIL=${FAIL_LEVEL:=ERROR}
66
MANAGE_PATH=${GITHUB_WORKSPACE}/${APP_PATH}
77
REQS=${GITHUB_WORKSPACE}/${DEP_PATH}
8+
ARGS=${EXTRA_ARGS}
89

910
echo -e "Path to manage.py set as: " $MANAGE_PATH
1011
echo -e "Requirements path set as: " $REQS
@@ -13,16 +14,16 @@ if [[ "$ENV_TYPE" == "pipenv" ]]; then
1314
cd $REQS
1415
pip3 install pipenv
1516
PIPENV_IGNORE_VIRTUALENVS=1 pipenv install
16-
cd $MANAGE_PATH && PIPENV_IGNORE_VIRTUALENVS=1 pipenv run python3 manage.py check --deploy --fail-level ${FAIL} &> output.txt
17+
cd $MANAGE_PATH && PIPENV_IGNORE_VIRTUALENVS=1 pipenv run python3 manage.py check --deploy --fail-level ${FAIL} ${ARGS} &> output.txt
1718
fi
1819
if [[ "$ENV_TYPE" == "venv" ]]; then
1920
pip install -r $REQS
20-
cd $MANAGE_PATH && python manage.py check --deploy --fail-level ${FAIL} &> output.txt
21+
cd $MANAGE_PATH && python manage.py check --deploy --fail-level ${FAIL} ${ARGS} &> output.txt
2122
fi
2223
if [[ -z "$ENV_TYPE" ]]; then
2324
echo "No virtual environment specified."
2425
pip install django
25-
cd $MANAGE_PATH && python manage.py check --deploy --fail-level ${FAIL} &> output.txt
26+
cd $MANAGE_PATH && python manage.py check --deploy --fail-level ${FAIL} ${ARGS} &> output.txt
2627
fi
2728

2829
echo -e "\n--------- Django Security Check results ---------"

0 commit comments

Comments
 (0)