-
Notifications
You must be signed in to change notification settings - Fork 27
59 lines (50 loc) · 2.13 KB
/
dependency-update.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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