Skip to content

Commit bb8bd9c

Browse files
committed
Comment a summary of changes included in staging and prod deployment PRs
1 parent 1db1f4f commit bb8bd9c

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: 'Summarize changes on staging and prod PRs'
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened, labeled, synchronize]
6+
branches: [staging, prod]
7+
8+
jobs:
9+
summarize-changes:
10+
name: Summarize changes
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
14+
with:
15+
ref: ${{ github.event.pull_request.head.sha }}
16+
17+
- name: Compute summary text
18+
id: summary
19+
run: 'echo "summary=$(git log ${{ github.base_ref }}..${{ github.head_ref }} --merges --first-parent --perl-regexp --grep=''from ecamp/renovate/'' --invert-grep | grep ''Merge pull request'' | awk ''{print \"- \"$4}'' | tac)" >> $GITHUB_OUTPUT'
20+
21+
- name: Comment summary on PR
22+
uses: thollander/actions-comment-pull-request@v3
23+
with:
24+
pr-number: ${{ github.event.pull_request.number }}
25+
message: |
26+
### <span aria-hidden="true">🏗️</span> Changes in this deployment
27+
28+
Includes the following non-renovate PRs:
29+
${{ steps.summary.outputs.summary }}
30+
31+
<details>
32+
<summary><small>Code to generate this overview</small></summary>
33+
34+
The above can be output locally using the following command:
35+
```bash
36+
echo 'Includes the following non-renovate PRs:' && git log origin/${{ github.base_ref }}..origin/${{ github.head_ref }} --merges --first-parent --perl-regexp --grep='from ecamp/renovate/' --invert-grep | grep "Merge pull request" | awk '{print "- "$4}' | tac
37+
```
38+
39+
</details>
40+
41+
comment-tag: deployment-pr-summary

0 commit comments

Comments
 (0)