Update LMS Plugin Repository #6506
This file contains 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 LMS Plugin Repository | |
on: | |
schedule: | |
- cron: "06 */6 * * *" | |
workflow_dispatch: | |
env: | |
MAX_REMOVAL_DIFF: 3 | |
jobs: | |
merge: | |
name: Update plugin repository | |
runs-on: ubuntu-24.04 | |
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 "noreply-extensions-updater@logitech.com" | |
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 }}" | |