Skip to content

Commit df3ad61

Browse files
committed
add if conditon for upgrade
1 parent ced1d0f commit df3ad61

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/pull-request-management.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,13 @@ jobs:
390390
# Install Python and Ansible dependencies if cache misses
391391
- name: Install Python requirements
392392
run: |
393-
pip install --cache-dir ~/.cache/pip -r .github/requirements-ci.txt --upgrade
394-
pip install --cache-dir ~/.cache/ansible-core "ansible-core<2.19.0"
393+
if pip install --upgrade --dry-run -r .github/requirements-ci.txt | grep -q "Would install"; then
394+
echo "Dependencies are outdated. Installing/upgrading..."
395+
pip install --cache-dir ~/.cache/pip -r .github/requirements-ci.txt --upgrade
396+
pip install --cache-dir ~/.cache/ansible-core "ansible-core<2.19.0"
397+
else
398+
echo "Dependencies are up-to-date. Skipping installation."
399+
fi
395400
396401
# Run ansible-test sanity
397402
- name: Run ansible-test sanity

0 commit comments

Comments
 (0)