-
Notifications
You must be signed in to change notification settings - Fork 150
58 lines (52 loc) · 2.07 KB
/
pr_diff.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: PR Diff for Helm chart
on:
pull_request_target:
permissions:
pull-requests: write
jobs:
diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: azure/setup-helm@v3
- name: Run diff
id: diff
run: |
OPTIONS=(
--namespace meta-namespace
--set serviceAccount.create=true
--set priorityClassName=high
--set podAnnotations.test=annotation
--set extraEnvVars[0].name=TEST_NAME
--set extraEnvVars[0].value=TEST_VALUE
--set extraVolumes[0].name=test
--set extraVolumes[0].emptyDir.medium=Memory
--set extraVolumeMounts[0].name=test
--set extraVolumeMounts[0].mountPath=/test
--set secrets.htpasswd=abc
--set tlsSecretName=abc
--set garbageCollect.enabled=true
--set namespace=target-namespace
--set proxy.enabled=true
--set storage=s3
--set secrets.s3.secretKey=abc
--set secrets.s3.accessKey=def
--set s3.region=us-42
--set s3.bucket=abc
--set s3.encrypt=abc
)
helm template --debug ${OPTIONS[@]} --output-dir before https://github.com/twuni/docker-registry.helm/archive/refs/heads/main.tar.gz
helm template --debug ${OPTIONS[@]} --output-dir after .
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
echo 'HELM_DIFF<<EOF' >> $GITHUB_ENV
echo "$(diff -ur before after)" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443
with:
message: |
Running a `helm template` smoketest on commit ${{ github.ref }} results in the following diff against `${{ github.base_ref }}`:
<details><summary>diff</summary><p>
```diff
${{ env.HELM_DIFF }}
```
</p></details>