Skip to content

Commit dfa9e40

Browse files
committed
Make example change to generic chart
1 parent f3817f8 commit dfa9e40

3 files changed

Lines changed: 38 additions & 26 deletions

File tree

.github/workflows/diff-changes.yml

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ jobs:
4545
permissions:
4646
pull-requests: write
4747
steps:
48+
- uses: actions/checkout@v4
49+
with:
50+
fetch-depth: 0
51+
ref: ${{ github.event.pull_request.head.ref }}
52+
show-progress: false
4853
- uses: actions/download-artifact@v4
4954
with:
5055
name: rendered-charts-base
@@ -56,29 +61,5 @@ jobs:
5661
- name: Diff charts and comment on PR
5762
env:
5863
GH_TOKEN: ${{ github.token }}
59-
run: |
60-
mkdir base head
61-
62-
mv base-r/rendered-charts/* base/
63-
mv head-r/rendered-charts/* head/
64-
65-
DIFF=$(diff -r base/ head/)
66-
67-
if [ -z "$DIFF" ]; then
68-
cat <<EOF > pr.md
69-
No changes detected in rendered charts.
70-
EOF
71-
else
72-
cat <<EOF > pr.md
73-
<details>
74-
<summary>Rendered charts diff</summary>
75-
This PR results in the following changes to rendered charts:
76-
77-
```diff
78-
${DIFF}
79-
```
80-
</details>
81-
EOF
82-
fi
83-
84-
gh pr comment "${{github.event.pull_request.html_url}}" --create-if-none --edit-last --body-file pr.md
64+
PR_URL: ${{ github.event.pull_request.html_url }}
65+
run: ./create-diff-pr.sh

charts/generic-govuk-app/templates/ingress.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ metadata:
1010
app: {{ $fullName }}
1111
app.kubernetes.io/name: {{ $fullName }}
1212
app.kubernetes.io/component: app
13+
some-other-label: something
1314
annotations:
1415
{{- (tpl (toYaml .Values.ingress.annotations) .) | trim | nindent 4 }}
1516
spec:

create-diff-pr.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
mkdir base head
5+
6+
mv base-r/rendered-charts/* base/
7+
mv head-r/rendered-charts/* head/
8+
9+
DIFF=$(diff -r base/ head/)
10+
11+
if [ -z "$DIFF" ]; then
12+
cat <<'EOF' > pr.md
13+
No changes detected in rendered charts.
14+
EOF
15+
else
16+
cat <<'EOF' > pr.md
17+
<details>
18+
<summary>Rendered charts diff</summary>
19+
This PR results in the following changes to rendered charts:
20+
21+
```diff
22+
EOF
23+
{
24+
echo "$DIFF"
25+
echo '```'
26+
echo '</details>'
27+
} >> pr.md
28+
fi
29+
30+
gh pr comment "${PR_URL}" --create-if-none --edit-last --body-file pr.md

0 commit comments

Comments
 (0)