From 184ce4cd785bed2933c5f6128d6b6c44899794c2 Mon Sep 17 00:00:00 2001 From: JJGadgets Date: Mon, 20 May 2024 07:08:50 +0800 Subject: [PATCH] fix(actions/flux-localhost-build): update or create --- .github/workflows/flux-localhost-build.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flux-localhost-build.yaml b/.github/workflows/flux-localhost-build.yaml index 07c99e52e1..2cf4839f5c 100644 --- a/.github/workflows/flux-localhost-build.yaml +++ b/.github/workflows/flux-localhost-build.yaml @@ -70,7 +70,6 @@ jobs: flux pull artifact oci://ghcr.io/fluxcd/flux-manifests:v${{ env.FLUX_VERSION }} --output /tmp/flux/ flux build kustomization zzz-flux --path /tmp/flux --kustomization-file ./kube/clusters/biohazard/flux/flux-install-localhost.yaml --dry-run | tee ./${{ env.OUTFILE }} - # below is yoinked from https://gist.github.com/swinton/03e84635b45c78353b1f71e41007fc7c - name: Commit Changes # with commit signing shell: bash @@ -89,5 +88,10 @@ jobs: --field encoding="base64" \ --field branch="${{ env.DESTINATION_BRANCH }}" \ --field sha="${SHA}" \ + || gh api --method PUT /repos/:owner/:repo/contents/${{ env.FILE_TO_COMMIT }} \ + --field message="${MESSAGE}" \ + --field content="${CONTENT}" \ + --field encoding="base64" \ + --field branch="${{ env.DESTINATION_BRANCH }}" \ || echo "No changes to push or errored pushing." - gh pr create --base main --head ${{ env.BRANCH }} --title "${{ env.MESSAGE }}" --body "Updates Flux install manifests, patched for use with localhost hostNetwork, to the ${{ env.FLUX_VERSION }} version." --reviewer ${{ github.repository_owner }} \ No newline at end of file + gh pr create --base main --head ${{ env.BRANCH }} --title "${{ env.MESSAGE }}" --body "Updates Flux install manifests, patched for use with localhost hostNetwork, to the ${{ env.FLUX_VERSION }} version." --reviewer ${{ github.repository_owner }}