hackathon-zurich/.forgejo/workflows/update.yaml
2024-02-03 13:43:00 +01:00

29 lines
868 B
YAML

on: [push]
jobs:
automate-ifc:
runs-on: self-hosted
steps:
- name: Install checkout
uses: https://github.com/actions/checkout@v4
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
- name: Get changed files
id: changed-files
uses: https://github.com/tj-actions/changed-files@v42
- name: Do computations
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
filename=$(basename -- "$file")
extension="${filename##*.}"
if [[ $extension == "py" ]]
then
echo "exec python file"
python3 $file
else
echo $extension
fi
done