-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.41 KB
/
process_json_reviews.yml
File metadata and controls
53 lines (44 loc) · 1.41 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
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
if: success() || failure() # Run even if previous step failed
run: |
git config --local user.email "action@github.com"
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/ || true
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]" || exit 0
git push origin HEAD:main || exit 0
fi