This commit is contained in:
2025-07-10 21:27:46 +03:00
parent 2592e7dbd1
commit dd524e1ffb

View File

@@ -9,6 +9,7 @@ on:
pull_request: pull_request:
branches: branches:
- main - main
workflow_dispatch: # Добавлено для ручного запуска
env: env:
BRANCH_NAME: "update-submodules_${{ github.sha }}" BRANCH_NAME: "update-submodules_${{ github.sha }}"
@@ -18,7 +19,7 @@ env:
jobs: jobs:
before: before:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'schedule' if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@@ -52,7 +53,7 @@ jobs:
update: update:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'schedule' if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
needs: before needs: before
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -77,7 +78,7 @@ jobs:
parse: parse:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true) || github.event_name == 'workflow_dispatch'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@@ -98,20 +99,20 @@ jobs:
git fetch origin git fetch origin
git checkout main git checkout main
git reset --hard origin/main git reset --hard origin/main
python3 parse.py
python3 -m venv venv python3 -m venv venv
source venv/bin/activate source venv/bin/activate
pip install --upgrade pip pip install --upgrade pip
pip install scikit-learn tqdm pip install requests scikit-learn tqdm
python3 parse.py
python3 categories.py python3 categories.py
git add modules.json git add modules.json
git commit -m "Updated modules.json after merge $(date +'%Y-%m-%d %H:%M:%S')" || echo "No changes for modules.json" git commit -m "Updated modules.json after merge $(date +'%Y-%m-%d %H:%M:%S')" || echo "No changes for modules.json"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@${REPO_URL}" git remote set-url origin "https://x-access-token:${GGithub_TOKEN}@${REPO_URL}"
git push origin main git push origin main
commit: commit:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'schedule' if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
needs: update needs: update
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -134,7 +135,7 @@ jobs:
create_pr: create_pr:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'schedule' if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
needs: commit needs: commit
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -154,7 +155,7 @@ jobs:
backup: backup:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: parse needs: parse
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with: