Skip to content

Commit bd78f52

Browse files
c-dilkstongtongcao
authored andcommitted
ci: comment details on dependabot submodule bump PRs (#981)
1 parent e0100b9 commit bd78f52

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/submodule.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Submodule Changes
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
8+
jobs:
9+
changes:
10+
name: Submodule Changes
11+
if: github.actor == 'dependabot[bot]'
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v6
15+
with:
16+
fetch-depth: 0
17+
submodules: true
18+
- name: get changes
19+
id: changes
20+
run: |
21+
for sm in $(grep 'path = ' .gitmodules | awk '{print $3}'); do
22+
git diff origin/${{ github.base_ref }} --submodule=log -- $sm | tee -a changes.txt
23+
done
24+
echo "changes<<EOF" >> $GITHUB_OUTPUT
25+
cat changes.txt >> $GITHUB_OUTPUT
26+
echo "EOF" >> $GITHUB_OUTPUT
27+
- name: comment
28+
uses: actions/github-script@v8
29+
with:
30+
script: |
31+
github.rest.issues.createComment({
32+
issue_number: context.issue.number,
33+
owner: context.repo.owner,
34+
repo: context.repo.repo,
35+
body: `## Submodule Changes\n\n\`\`\`\n${{ steps.changes.outputs.changes }}\n\`\`\``
36+
})

0 commit comments

Comments
 (0)