From e2d0ab22b7d0a92ab9c703571aa6c842d1e28b50 Mon Sep 17 00:00:00 2001
From: JJGadgets <git@jjgadgets.tech>
Date: Mon, 20 May 2024 07:42:48 +0800
Subject: [PATCH] fix(actions/flux-localhost-build): use file reference for
 commit content

argument list too long
---
 .github/workflows/flux-localhost-build.yaml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/flux-localhost-build.yaml b/.github/workflows/flux-localhost-build.yaml
index 2e5015432a..c3afe60259 100644
--- a/.github/workflows/flux-localhost-build.yaml
+++ b/.github/workflows/flux-localhost-build.yaml
@@ -81,17 +81,17 @@ jobs:
         run: |
           export MESSAGE="${{ env.MESSAGE }}"
           export SHA=$( git rev-parse ${{ env.DESTINATION_BRANCH }}:${{ env.FILE_TO_COMMIT }} )
-          export CONTENT=$( base64 -i ${{ env.FILE_TO_COMMIT }} )
+          base64 -i -w0 ${{ env.FILE_TO_COMMIT }} > /tmp/base64data
           if gh api --method PUT /repos/:owner/:repo/contents/${{ env.FILE_TO_COMMIT }} \
               --field message="${MESSAGE}" \
-              --field content="${CONTENT}" \
+              --field content="@/tmp/base64data" \
               --field encoding="base64" \
               --field branch="${{ env.DESTINATION_BRANCH }}" \
               --field sha="${SHA}" ; then
             echo "Pushed signed commit to GitHub."
           elif gh api --method PUT /repos/:owner/:repo/contents/${{ env.FILE_TO_COMMIT }} \
               --field message="${MESSAGE}" \
-              --field content="${CONTENT}" \
+              --field content="@/tmp/base64data" \
               --field encoding="base64" \
               --field branch="${{ env.DESTINATION_BRANCH }}" ; then
             echo "Pushed signed commit to GitHub."