Merge branch 'master' of github.com:steveraysteveray/sandbox #4
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: Run Python Script on Push | |
on: [push] | |
jobs: | |
run-script: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Get changed files | |
id: getfile | |
run: | | |
files=$(git diff --name-only HEAD~1..HEAD | grep ".ttl$") | |
echo "::set-output name=files::$files" | |
- name: Run Python script on changed files | |
run: | | |
IFS=' ' read -ra ADDR <<< "${{ steps.getfile.outputs.files }}" | |
for file in "${ADDR[@]}"; do | |
python add-base.py "$file" | |
done |