mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Refactor update-submodules workflow to handle central branch and update components submodule
This commit is contained in:
40
.github/workflows/update-submodules.yml
vendored
Normal file
40
.github/workflows/update-submodules.yml
vendored
Normal 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
|
||||
|
||||
|
Reference in New Issue
Block a user