Skip to content

Commit 04ca322

Browse files
authored
Merge pull request #63 from janhoy/requirements-txt-support
INFRA-25890 Pelican Action: Add support for installing requirements.txt
2 parents f1c2095 + 5633f12 commit 04ca322

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

pelican/README.md

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

1213
## Example Workflow Usage:
1314

pelican/action.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ inputs:
2929
description: "Pelican Version (default 4.5.4)"
3030
required: false
3131
default: '4.5.4'
32+
requirements:
33+
description: "Python requirements file name to install. Default=requirements.txt"
34+
required: false
35+
default: 'requirements.txt'
3236
fatal:
3337
description: "Value for --fatal option [errors|warnings] - sets exit code to error (default: errors)"
3438
required: false
@@ -101,6 +105,13 @@ runs:
101105
echo "Getting plugins from action location: ${{ github.action_path }}"
102106
PP=$(python3 ${{ github.action_path }}/plugin_paths.py '${{ github.action_path }}/plugins')
103107
set -x # Show the expanded variables
108+
if [ -f "${{ inputs.requirements }}" ]
109+
then
110+
echo "Installing python requirements from ${{ inputs.requirements }}"
111+
pip3 install -r ${{ inputs.requirements }}
112+
else
113+
echo "Requirements file ${{ inputs.requirements }} does not exist"
114+
fi
104115
python3 -B -m pelican content -e "$PP" -o ${{ inputs.tempdir }} $OPTS
105116
106117
- name: Check out previous branch

0 commit comments

Comments
 (0)