chore: add workflow to find the python dependencies in repo #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Python Dependencies | |
on: | |
pull_request: | |
defaults: | |
run: | |
shell: bash # strict bash | |
jobs: | |
check_dependencies: | |
name: Check Python Dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install 'https://github.com/openedx/repo-tools[find_dependencies]' | |
- name: Run dependency check | |
run: | | |
python finding_dependency.py | |
- name: Check if any dependency belongs to openedx | |
run: | | |
if grep -q openedx /tmp/unpack_reqs/repo_urls.txt; then | |
echo "A dependency belongs to openedx organization" | |
exit 0 # Pass the check | |
else | |
echo "No dependency belongs to openedx organization" | |
exit 1 # Fail the check | |
fi |