From 8ce5a40b471d5db2fe975afdfc8fcae4e912a3ab Mon Sep 17 00:00:00 2001 From: Devin Canterberry Date: Wed, 17 Aug 2022 11:40:34 -0700 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=94=A5=20Remove=20duplicate=20trigger?= =?UTF-8?q?=20for=20PR=20diff=20GitHub=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr_diff.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr_diff.yaml b/.github/workflows/pr_diff.yaml index f1d4759..a916693 100644 --- a/.github/workflows/pr_diff.yaml +++ b/.github/workflows/pr_diff.yaml @@ -1,8 +1,7 @@ name: PR Diff for Helm chart on: - pull_request: pull_request_target: - + permissions: pull-requests: write From 91dd5f292897c7f35e4042be31fcb8dcd700f5c7 Mon Sep 17 00:00:00 2001 From: Devin Canterberry Date: Wed, 17 Aug 2022 11:43:37 -0700 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=9A=A6=20Add=20extraVolumes=20and=20e?= =?UTF-8?q?xtraVolumeMounts=20to=20PR=20diff=20GitHub=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr_diff.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pr_diff.yaml b/.github/workflows/pr_diff.yaml index a916693..fb1aa1b 100644 --- a/.github/workflows/pr_diff.yaml +++ b/.github/workflows/pr_diff.yaml @@ -20,6 +20,10 @@ jobs: --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 From c7b3257baa2321d9033dd8cdc2128834173e7684 Mon Sep 17 00:00:00 2001 From: Devin Canterberry Date: Wed, 17 Aug 2022 11:56:49 -0700 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=9A=A6=20Add=20release=20namespace=20?= =?UTF-8?q?and=20target=20namespaces=20to=20PR=20diff=20action=20test=20va?= =?UTF-8?q?lues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr_diff.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr_diff.yaml b/.github/workflows/pr_diff.yaml index fb1aa1b..aae7594 100644 --- a/.github/workflows/pr_diff.yaml +++ b/.github/workflows/pr_diff.yaml @@ -15,6 +15,7 @@ jobs: id: diff run: | OPTIONS=( + --namespace meta-namespace --set serviceAccount.create=true --set priorityClassName=high --set podAnnotations.test=annotation @@ -27,6 +28,7 @@ jobs: --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 From 836f46131f23a0080450afdd1429f9ede4ce2879 Mon Sep 17 00:00:00 2001 From: Devin Canterberry Date: Wed, 17 Aug 2022 12:08:20 -0700 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=9A=A6=20Hard-coding=20the=20"before"?= =?UTF-8?q?=20chart=20URL=20in=20the=20PR=20diff=20GitHub=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While this may not be strictly necessary, it's the correct resolution enough of the time that the clarity of explicitly stating the "before" is, I think, worth it. --- .github/workflows/pr_diff.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_diff.yaml b/.github/workflows/pr_diff.yaml index aae7594..52f6a42 100644 --- a/.github/workflows/pr_diff.yaml +++ b/.github/workflows/pr_diff.yaml @@ -1,4 +1,5 @@ name: PR Diff for Helm chart + on: pull_request_target: @@ -37,7 +38,7 @@ jobs: --set s3.bucket=abc --set s3.encrypt=abc ) - helm template --debug ${OPTIONS[@]} --output-dir before ${{ github.server_url }}/${{ github.repository }}/archive/refs/heads/${{ github.base_ref }}.tar.gz + 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<> $GITHUB_ENV