2024-11-28 16:48:38 +08:00
|
|
|
name: Process Apps and Commit Changes
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- appstore
|
2024-11-28 17:06:53 +08:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- appstore
|
2024-11-28 16:48:38 +08:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
process:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2024-11-28 16:49:55 +08:00
|
|
|
uses: actions/checkout@v4
|
2024-11-28 16:48:38 +08:00
|
|
|
|
|
|
|
- name: Setup Python
|
2024-11-28 17:00:03 +08:00
|
|
|
uses: actions/setup-python@v5
|
2024-11-28 16:48:38 +08:00
|
|
|
with:
|
|
|
|
python-version: '3.10'
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install pyyaml
|
|
|
|
|
|
|
|
- name: Run processing script
|
|
|
|
run: python process-apps.py
|
|
|
|
|
2024-11-28 16:59:01 +08:00
|
|
|
- name: Verify generated directories
|
2024-11-28 16:48:38 +08:00
|
|
|
run: |
|
2024-11-28 16:59:01 +08:00
|
|
|
ls -R appstore || echo "appstore not created"
|
|
|
|
ls -R dockge || echo "dockge not created"
|
2024-11-28 16:48:38 +08:00
|
|
|
|
|
|
|
- name: Configure Git
|
|
|
|
run: |
|
|
|
|
git config --global user.name "${{ github.actor }}"
|
|
|
|
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
|
|
|
|
|
|
|
|
- name: Commit and push changes
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: |
|
2024-11-28 17:02:57 +08:00
|
|
|
git fetch origin appstore
|
|
|
|
git rebase origin/appstore
|
2024-11-28 16:59:01 +08:00
|
|
|
git add appstore dockge || echo "No changes to add"
|
2024-11-28 17:02:57 +08:00
|
|
|
git diff --cached --quiet && echo "No changes to commit" || git commit -m "Processed apps directory via GitHub Actions"
|
|
|
|
git push origin appstore
|