forked from inspirezonetech/TeachMePythonLikeIm5
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecute-modified-python-file.yml
More file actions
40 lines (32 loc) · 951 Bytes
/
execute-modified-python-file.yml
File metadata and controls
40 lines (32 loc) · 951 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: execute-modified-python-file
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
job-execute-python:
runs-on: ubuntu-latest
steps:
# checkout repo
- uses: actions/checkout@v2
# setup python
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
# install requirements.txt if it exists
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
#use action to get file that changed
- uses: lots0logs/gh-action-get-changed-files@2.1.4
with:
token: ${{ secrets.GITHUB_TOKEN }}
# test if modified file will run
- name: Execute file!
run: |
echo "job: running script to execute modified file:"
./.github/workflows/run-modified-python.sh
echo "job: Done"