Skip to content

Temp Files Deletion #481

Temp Files Deletion

Temp Files Deletion #481

name: Temp Files Deletion
on:
workflow_run:
workflows: ["JSON Generation"]
types:
- completed
jobs:
del_temp_files:
runs-on: ubuntu-latest
steps:
- name: Check the previous workflow
if: github.event.workflow_run.conclusion == 'success'
run: echo "Previous workflow OK"
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: |
requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Verify Python environment
run: |
python --version
pip --version
pip list
- name: Run JSON generation scripts
run: |
echo "Working Directory: $(pwd)"
echo "Files in Current Directory: $(ls -al)"
python scripts/090_Final_Actions/091_Delete_Temp_Files.py
- name: Commit changes
run: |
git config --global user.email "${{ secrets.GIT_EMAIL }}"
git config --global user.name "${{ secrets.GIT_USERNAME }}"
if git diff --quiet -- data/json/; then
echo "No changes in data/json directory. Skipping commit."
else
git add -A data/json
git commit -m "Update data/json"
git push
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}