Files
docker-registry.helm/.github/workflows/pr_diff.yaml
2022-08-10 13:09:44 +02:00

42 lines
1.6 KiB
YAML

name: PR Diff for Helm chart
on:
pull_request:
jobs:
diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: azure/setup-helm@v3
- name: Run diff
id: diff
run: |
alias helm_test_template='helm template --debug \
--set serviceAccount.create=true \
--set priorityClassName=high \
--set podAnnotations.test=annotation \
--set extraEnvVars[0].name=TEST_NAME \
--set extraEnvVars[0].value=TEST_VALUE \
--set secrets.htpasswd=abc \
--set tlsSecretName=abc \
--set garbageCollect.enabled=true \
--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'
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
echo 'HELM_DIFF<<EOF' >> $GITHUB_ENV
diff -u <(helm_test_template ${{ github.server_url }}/${{ github.repository }}/archive/refs/heads/${{ github.base_ref }}.tar.gz) <(helm_test_template .) >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
Running a `helm template` smoketest on this branch results in the following diff against `${{ github.base_ref }}`:
```diff
${{ env.HELM_DIFF }}
```