Skip to content

Commit a9d3244

Browse files
committed
Include PR summary in dependency PRs
1 parent d3b6a63 commit a9d3244

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/watch-dependencies.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,19 @@ jobs:
7676
if: steps.local.outputs.tag != steps.latest.outputs.tag
7777
run: git --no-pager diff --color=always
7878

79+
- name: PR summary
80+
id: prsummary
81+
if: steps.local.outputs.tag != steps.latest.outputs.tag
82+
# Needs to be a single line string
83+
# https://trstringer.com/github-actions-multiline-strings/#option-1---string-substitution
84+
run: |
85+
pip install PyGithub
86+
PR_LIST=$(./scripts/get-prs.py ${{matrix.repository}} ${{steps.local.outputs.tag}} ${{steps.latest.outputs.tag}})
87+
PR_LIST="${PR_LIST//$'\n'/'%0A'}"
88+
echo "::set-output name=prs::$PR_LIST"
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
7992
# ref: https://github.com/peter-evans/create-pull-request
8093
- name: Create a PR
8194
uses: peter-evans/[email protected]
@@ -93,6 +106,9 @@ jobs:
93106
body: |
94107
Updates mybinder to depend on the `${{ matrix.registry }}/${{ matrix.repository }}` image version `${{ steps.latest.outputs.tag }}` from version `${{ steps.local.outputs.tag }}`.
95108
109+
## Merged PRs:
110+
${{ steps.prsummary.outputs.prs }}
111+
96112
## Related
97113
98114
- Source code: ${{ matrix.source_url }}
@@ -119,30 +135,35 @@ jobs:
119135
chart_dep_app_changelog_url: "https://github.com/jupyterhub/binderhub/blob/master/CHANGES.md"
120136
chart_dep_source_url: "https://github.com/jupyterhub/binderhub/tree/master/helm-chart"
121137
chart_dep_devel_flag: "--devel"
138+
github_repo: jupyterhub/binderhub
122139

123140
- chart_dep_name: ingress-nginx
124141
chart_dep_chart_changelog_url: "https://github.com/kubernetes/ingress-nginx/tree/main/charts/ingress-nginx#upgrading-chart"
125142
chart_dep_app_changelog_url: "https://github.com/kubernetes/ingress-nginx/blob/master/Changelog.md"
126143
chart_dep_source_url: "https://github.com/kubernetes/ingress-nginx/tree/master/charts/ingress-nginx"
127144
chart_dep_devel_flag: ""
145+
github_repo: ""
128146

129147
- chart_dep_name: prometheus
130148
chart_dep_chart_changelog_url: "https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus#upgrading-chart"
131149
chart_dep_app_changelog_url: "https://github.com/prometheus/prometheus/blob/master/CHANGELOG.md"
132150
chart_dep_source_url: https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus
133151
chart_dep_devel_flag: ""
152+
github_repo: ""
134153

135154
- chart_dep_name: grafana
136155
chart_dep_chart_changelog_url: "https://github.com/grafana/helm-charts/tree/main/charts/grafana#upgrading-an-existing-release-to-a-new-major-version"
137156
chart_dep_app_changelog_url: "https://github.com/grafana/grafana/blob/master/CHANGELOG.md"
138157
chart_dep_source_url: "https://github.com/grafana/helm-charts/tree/main/charts/grafana"
139158
chart_dep_devel_flag: ""
159+
github_repo: ""
140160

141161
- chart_dep_name: cryptnono
142162
chart_dep_chart_changelog_url: ""
143163
chart_dep_app_changelog_url: ""
144164
chart_dep_source_url: "https://github.com/yuvipanda/cryptnono/"
145165
chart_dep_devel_flag: "--devel"
166+
github_repo: ""
146167

147168
steps:
148169
- uses: actions/checkout@v3
@@ -185,6 +206,19 @@ jobs:
185206
- name: git diff
186207
run: git --no-pager diff --color=always
187208

209+
- name: PR summary
210+
id: prsummary
211+
if: matrix.github_repo && (steps.local.outputs.version != steps.latest.outputs.version)
212+
# Needs to be a single line string
213+
# https://trstringer.com/github-actions-multiline-strings/#option-1---string-substitution
214+
run: |
215+
pip install PyGithub
216+
PR_LIST=$(./scripts/get-prs.py ${{matrix.github_repo}} ${{steps.local.outputs.version}} ${{steps.latest.outputs.version}})
217+
PR_LIST="${PR_LIST//$'\n'/'%0A'}"
218+
echo "::set-output name=prs::$PR_LIST"
219+
env:
220+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
221+
188222
# ref: https://github.com/peter-evans/create-pull-request
189223
- name: Create a PR
190224
uses: peter-evans/[email protected]
@@ -207,6 +241,9 @@ jobs:
207241
Chart.yaml's version | `${{ steps.local.outputs.version }}` | `${{ steps.latest.outputs.version }}`
208242
Chart.yaml's appVersion | `${{ steps.local.outputs.appVersion }}` | `${{ steps.latest.outputs.appVersion }}`
209243
244+
## Merged PRs:
245+
${{ steps.prsummary.outputs.prs }}
246+
210247
## Related
211248
212249
- Chart source code: ${{ matrix.chart_dep_source_url }}

0 commit comments

Comments
 (0)