Skip to content

Commit d4d900b

Browse files
committed
Add support for installing requirements.txt
1 parent eeb431f commit d4d900b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pelican/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* tempdir Temporary Directory name (optional) default: ../output
88
* debug Pelican Debug mode (optional) default: false
99
* version Pelican Version (default 4.5.4) (optional) default: 4.5.4
10+
* requirements Python Requirements file (optional) default: requirements.txt
1011

1112
## Example Workflow Usage:
1213

pelican/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ inputs:
2525
description: "Pelican Version (default 4.5.4)"
2626
required: false
2727
default: '4.5.4'
28+
requirements:
29+
description: "Python requirements file name to install. Default=requirements.txt"
30+
required: false
31+
default: 'requirements.txt'
2832
fatal:
2933
description: "Value for --fatal option [errors|warnings] - sets exit code to error (default: errors)"
3034
required: false
@@ -97,6 +101,11 @@ runs:
97101
echo "Getting plugins from action location: ${{ github.action_path }}"
98102
PP=$(python3 ${{ github.action_path }}/plugin_paths.py '${{ github.action_path }}/plugins')
99103
set -x # Show the expanded variables
104+
if [ -f "${{ inputs.requirements }}" ]
105+
then
106+
echo "Installing python requirements from ${{ inputs.requirements }}"
107+
pip3 install -r ${{ inputs.requirements }}
108+
fi
100109
python3 -B -m pelican content -e "$PP" -o ${{ inputs.tempdir }} $OPTS
101110
102111
- name: Check out previous branch

0 commit comments

Comments
 (0)