Skip to content

Update Extension Hub #509

Update Extension Hub

Update Extension Hub #509

Workflow file for this run

## -------------------------------------------------------------------------------------------------
## -- Project : MLPro - The integrative middleware framework for standardized machine learning
## -- Workflow: extension_hub.yml
## -------------------------------------------------------------------------------------------------
## -- History :
## -- yyyy-mm-dd Ver. Auth. Description
## -- 2023-10 1.0.0 DA Creation
## -- 2024-10-09 2.0.0 DA Restructuring and introduction of PR-based processing
## -- 2024-10-16 2.1.0 DA Step 3: creation of virtual environment due to new security
## -- restrictions in Python 3.12
## -------------------------------------------------------------------------------------------------
name: Update Extension Hub
on:
schedule:
- cron: '00 22 * * *'
workflow_dispatch:
jobs:
update-extension-hub:
name: Update the MLPro extension hub
runs-on: ubuntu-latest
steps:
- name: Step 1 - Checkout code
id: step1
uses: actions/checkout@v3
- name: Step 2 - Preparation
id: step2
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b temp-branch
- name: Step 3 - Updates on the extension hub
id: step3
run: |
python3 -m venv venv
source venv/bin/activate
pip3 install PyGithub
python3 ${GITHUB_WORKSPACE}/extensions/update_extension_hub.py ${{ secrets.EXTENSION_HUB_UPDATES }} ../doc/rtd/content/04_extensions/sub/
- name: Step 4 - Commit changes
id: step4
run: |
git add ${GITHUB_WORKSPACE}/doc/rtd/content/04_extensions/
git commit -m 'MLPro extension hub updated'
continue-on-error: true
- name: Step 5 - Pull/push changes
id: step5
if: ${{ steps.step4.outcome == 'success' }}
run: git push origin temp-branch
- name: Step 6 - Create Pull Request
id: step6
if: ${{ steps.step5.outcome == 'success' }}
env:
GITHUB_TOKEN: ${{ secrets.EXTENSION_HUB_UPDATES }}
run: gh pr create --title "Update Extension Hub" --body "This PR was created automatically." --head temp-branch --base main
- name: Step 7 - Auto-Review Pull Request
id: step7
if: ${{ steps.step6.outcome == 'success' }}
env:
GITHUB_TOKEN: ${{ secrets.EXTENSION_HUB_REVIEW_DA }}
run: gh pr review --approve temp-branch
- name: Step 8 - Merge Pull Request
id: step8
if: ${{ steps.step7.outcome == 'success' }}
env:
GITHUB_TOKEN: ${{ secrets.EXTENSION_HUB_UPDATES }}
run: gh pr merge --auto --delete-branch --merge