Update Matter SDK submodule #198
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 Matter SDK submodule | |
on: | |
schedule: | |
# Runs at 04:30 UTC every day | |
- cron: '30 04 * * *' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
update-connectedhomeip-submodule: | |
runs-on: ubuntu-latest | |
name: Update Matter SDK submodule | |
steps: | |
# Checkout the repository | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: false | |
# Required to push to git repo and trigger push CI run for the PR | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
# Update submodule (not recursive) | |
- name: Update Submodule | |
id: update-submodule | |
run: | | |
git submodule update --init connectedhomeip/ | |
short_hash_before=$(cd connectedhomeip && git rev-parse --short HEAD) | |
echo "short_hash_before=${short_hash_before}" >> $GITHUB_OUTPUT | |
git submodule update --remote connectedhomeip/ | |
git add connectedhomeip/ | |
if git diff-index --quiet HEAD; then | |
echo "empty=true" >> $GITHUB_OUTPUT | |
exit 0 | |
fi | |
short_hash=$(cd connectedhomeip && git rev-parse --short HEAD) | |
echo "short_hash=${short_hash}" >> $GITHUB_OUTPUT | |
# Create Pull Request only if there were changes | |
- name: Create Pull Request | |
if: ${{ steps.update-submodule.outputs.empty != true }} | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
commit-message: Update Matter SDK to `${{ steps.update-submodule.outputs.short_hash }}` | |
title: Update Matter SDK to `${{ steps.update-submodule.outputs.short_hash }}` | |
body: > | |
Bumps [connectedhomeip](https://github.com/project-chip/connectedhomeip) | |
from `${{ steps.update-submodule.outputs.short_hash_before }}` to | |
`${{ steps.update-submodule.outputs.short_hash }}`. | |
See full diff at | |
https://github.com/project-chip/connectedhomeip/compare/${{ steps.update-submodule.outputs.short_hash_before }}...${{ steps.update-submodule.outputs.short_hash }}. | |
branch: update-connectedhomeip-submodule-to-latest-master | |