This repository provides a composite GitHub Action to automate updating the matter_sdk submodule and create a pull request with the update.
The composite action checks out the repository, updates the third_party/matter_sdk submodule to the latest commit on a specified branch, and creates a pull request if there are changes. This helps keep the submodule up to date with minimal manual intervention.
This repo is necessary for updates of matter_sdk as dependabot crashes due to disk space issues because of the size of this submodule. This action is extensible to other repos which may have this limitation in the future.
Below is an example workflow that demonstrates how to use this action with a matrix strategy to update the matter_sdk submodule on multiple branches.
name: Update matter_sdk Submodule
permissions:
contents: read
on:
schedule:
- cron: '0 5 * * *' # Daily at midnight
workflow_dispatch:
inputs:
target_branch:
description: 'Target branch to update'
required: false
default: 'main'
jobs:
update-matter_sdk:
runs-on: ubuntu-latest
strategy:
matrix:
target_branch: >-
${{
github.event_name == 'schedule'
&& fromJson('["main","release_2.8-1.5","<branch_name>"]')
|| fromJson(format('["{0}"]', inputs.target_branch))
}}
steps:
- name: Checkout target branch
uses: actions/checkout@v6
with:
ref: ${{ matrix.target_branch }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update matter_sdk submodule
uses: SiliconLabsSoftware/matter_update_submodules@main
with:
target_branch: ${{ matrix.target_branch }}
app-id: ${{ vars.SILABSSW_MATTER_CI_BOT_APP_ID }}
private-key: ${{ secrets.SILABSSW_MATTER_CI_BOT_APP_PRIVATE_KEY }}target_branch: The branch to update the submodule on.- On
scheduletrigger, user can add/remove branches infromJson('["main","release_2.8-1.5","<branch_name>"]')to update daily - On
workflow_dispatchtrigger from UI, user can manually input branch name to update submodule on
- On
app-id: GitHub App ID for authentication.private-key: GitHub App private key for authentication.
pr_branch: The name of the created PR branch. Use case is formatter_extensionrepo to be able to run scripts and push commits to this created PR.
- Generates a GitHub App token using the provided App ID and private key.
- Checks out the repository at the specified target branch.
- Updates the
third_party/matter_sdksubmodule to the latest commit on the same branch. - If the submodule was updated, creates a pull request with the changes.
- A GitHub App with permissions to create pull requests and update submodules.
- The App ID and private key must be provided as secrets.
See the LICENSE.md file for details.