Refactor update-submodules workflow to handle central branch and update components submodule

This commit is contained in:
mr. M
2024-10-11 19:27:10 +02:00
parent 3a2ad6e578
commit f2058851d0

40
.github/workflows/update-submodules.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Update Components Submodules
on:
push:
branches:
- central
pull_request:
branches:
- central
workflow_dispatch:
workflow_call: # This is a custom event that we will trigger manually
jobs:
update-submodules:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: 'recursive'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update submodules
run: |
# Only update the "components" submodule, we want to ignore l10n
git submodule update --init --recursive components
current_path=$(pwd)
submodule_path=$(git config --file .gitmodules --get-regexp path | awk '{ print $2 }' | grep components --color=never)
cd $submodule_path
git checkout master
git pull
cd $current_path
git add .
git commit -m "[skip ci] 📦 Update Submodules!"
git push