Skip to content

Update LMS Plugin Repository #5732

Update LMS Plugin Repository

Update LMS Plugin Repository #5732

name: Update LMS Plugin Repository
on:
schedule:
- cron: "06 */6 * * *"
workflow_dispatch:
env:
MAX_REMOVAL_DIFF: 3
jobs:
merge:
name: Update plugin repository
runs-on: ubuntu-latest
steps:
- name: Install depedencies
run: sudo apt-get install libjson-perl libxml-simple-perl libwww-perl
- name: Checkout
uses: actions/checkout@v4
- name: Merge repository files
id: merge
run: |
perl buildrepo.pl
echo "name=LMS_REPO_DIFF_VALUE::$(git diff --numstat | fgrep extensions.xml | awk '{ print $2-$1 }') >> $GITHUB_OUTPUT"
- name: Push Changes (if needed and reasonable)
if: steps.merge.outputs.LMS_REPO_DIFF_VALUE < env.MAX_REMOVAL_DIFF
run: |
if [ -z "$(git status --porcelain)" ]; then
echo No changes to commit
else
git config user.name "LMS Extensions Repository Updater"
git config user.email "[email protected]"
git commit -a -m "Update Extensions Repository ${{ github.event.inputs.version }}"
git push
fi
- name: Create Pull Request (if needed)
if: steps.merge.outputs.LMS_REPO_DIFF_VALUE >= env.MAX_REMOVAL_DIFF
uses: peter-evans/create-pull-request@v4
with:
branch: autoupdate
delete-branch: true
title: "LMS Extensions Repository Update: ${{ github.sha }}"
commit-message: "LMS Extensions Repository Update: ${{ github.sha }}"