Update Submodules #279
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 Submodules | |
on: | |
workflow_dispatch: | |
inputs: | |
DISPATCH_REPO_NAME: | |
required: true | |
description: repo name to dispatch | |
type: string | |
DISPATCH_REPO_SHA: | |
required: true | |
description: repo SHA to dispatch | |
type: string | |
jobs: | |
update_submodules: | |
if: ${{ github.ref == 'refs/heads/dev' }} | |
name: Update Submodules | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
submodules: true | |
fetch-depth: 0 | |
- name: Checkout ${{ github.ref_name }} branch for each of the submodules | |
run: | | |
git submodule update --init --recursive --remote lib/${{ inputs.DISPATCH_REPO_NAME }} | |
git submodule set-branch --branch main lib/${{ inputs.DISPATCH_REPO_NAME }} | |
cd lib/${{ inputs.DISPATCH_REPO_NAME }} | |
git checkout ${{inputs.DISPATCH_REPO_SHA}} | |
cd ../../ | |
git checkout .gitmodules | |
- name: Run Git Status | |
run: git status | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
base: ${{ github.ref_name }} | |
branch: Updates/submodule-${{ inputs.DISPATCH_REPO_NAME }}-updates | |
title: "release: ${{ inputs.DISPATCH_REPO_NAME }}@${{ github.ref_name }} - ${{inputs.DISPATCH_REPO_SHA}}" | |
commit-message: "release: ${{ inputs.DISPATCH_REPO_NAME }}@${{ github.ref_name }} - ${{inputs.DISPATCH_REPO_SHA}}" | |
labels: automated-bot |