-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yaml
More file actions
25 lines (22 loc) · 909 Bytes
/
action.yaml
File metadata and controls
25 lines (22 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
name: Install a Python Package
description: 'Installs a specified Python package from a requirements file, allowing for flexible package management.'
inputs:
requirements-path:
required: true
description: Path to the requirements file
package:
required: true
description: Package you would like to install from the requirements file
runs:
using: composite
steps:
- name: Extract Package Version
id: extract_package_version
shell: bash
run: |
echo "PACKAGE_LINE=$(grep -w "^${{ inputs.package }}" ${{ inputs.requirements-path }} || echo "${{ inputs.package }}")" >> $GITHUB_OUTPUT
- name: Install Package
shell: bash
run: |
python -m pip install --upgrade pip
pip install "${{ steps.extract_package_version.outputs.PACKAGE_LINE }}"