[夏令营] 河北工业大学 #832
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update JSON on Issue Closed | |
| on: | |
| issues: | |
| types: [closed] | |
| concurrency: | |
| group: update-json-queue | |
| cancel-in-progress: false | |
| jobs: | |
| update-json: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: 3.x | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| - name: Pull changes | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config --global user.name 'github-actions' | |
| git config --global user.email '[email protected]' | |
| git pull | |
| - name: Update JSON with issue content | |
| run: | | |
| python scripts/update_json.py | |
| env: | |
| GITHUB_EVENT_PATH: ${{ github.event_path }} | |
| - name: Commit and push changes | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config --global user.name 'github-actions' | |
| git config --global user.email '[email protected]' | |
| git add data.json | |
| git add camp2025-by-province.json | |
| git commit -m "Update data.json from issue" | |
| git push |