Skip to content

Add files via upload #4

Add files via upload

Add files via upload #4

name: Process JSON Reviews
on:
push:
branches: [ main ]
paths:
- 'reviews/*.json'
workflow_dispatch: # Allow manual trigger
permissions:
contents: write
issues: write
jobs:
process-reviews:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install PyGithub>=2.1.0
- name: Process JSON reviews and create Issues
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/process_json_reviews.py
- name: Commit and push processed files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git add reviews/processed/
if git diff --staged --quiet; then
echo "No processed files to commit"
else
git commit -m "Move processed JSON reviews to processed/ directory [skip ci]"
git push origin HEAD:main
fi