File tree Expand file tree Collapse file tree 2 files changed +23
-9
lines changed Expand file tree Collapse file tree 2 files changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -71,17 +71,20 @@ jobs:
7171 set -o pipefail
7272 set -o xtrace
7373
74+ # Base64 encode JSON to avoid whitespace issues in env file
75+ ENCODED_JSON=$(echo "${INPUT_EVENTJSON}" | base64 -w 0)
76+
7477 cat > /tmp/docker.env << EOF
75- INPUT_ZITIID=" ${INPUT_ZITIID}"
76- INPUT_WEBHOOKURL=" ${INPUT_WEBHOOKURL}"
77- INPUT_EVENTJSON="${INPUT_EVENTJSON}"
78- INPUT_SENDERUSERNAME=" ${INPUT_SENDERUSERNAME}"
79- INPUT_SENDERICONURL=" ${INPUT_SENDERICONURL}"
80- INPUT_ZITILOGLEVEL=" ${INPUT_ZITILOGLEVEL}"
81- GITHUB_WORKSPACE=" ${GITHUB_WORKSPACE}"
78+ INPUT_ZITIID=${INPUT_ZITIID}
79+ INPUT_WEBHOOKURL=${INPUT_WEBHOOKURL}
80+ INPUT_EVENTJSON_B64=${ENCODED_JSON}
81+ INPUT_SENDERUSERNAME=${INPUT_SENDERUSERNAME}
82+ INPUT_SENDERICONURL=${INPUT_SENDERICONURL}
83+ INPUT_ZITILOGLEVEL=${INPUT_ZITILOGLEVEL}
84+ GITHUB_WORKSPACE=${GITHUB_WORKSPACE}
8285 EOF
8386
84- # configure the kernel to write core dumps to the workspace directory that is writable by the container
87+ # configure the kernel to write core dumps to the workspace directory that is writable by the container in case there is a segfault valgrind cannot catch in a vgcore.%p
8588 sudo sysctl -w kernel.core_pattern="${GITHUB_WORKSPACE}/core.%e.%p.%t"
8689
8790 # build the action's container image so we can source it for the debug image
Original file line number Diff line number Diff line change 44import openziti
55import json
66import os
7+ import base64
78
89
910class MattermostWebhookBody :
@@ -351,7 +352,17 @@ def dumpJson(self):
351352
352353if __name__ == '__main__' :
353354 url = os .getenv ("INPUT_WEBHOOKURL" )
354- eventJsonStr = os .getenv ("INPUT_EVENTJSON" )
355+
356+ # Handle both base64-encoded and direct JSON input
357+ eventJsonB64 = os .getenv ("INPUT_EVENTJSON_B64" )
358+ if eventJsonB64 :
359+ try :
360+ eventJsonStr = base64 .b64decode (eventJsonB64 ).decode ('utf-8' )
361+ except Exception as e :
362+ print (f"Failed to decode base64 event JSON: { e } " )
363+ eventJsonStr = os .getenv ("INPUT_EVENTJSON" )
364+ else :
365+ eventJsonStr = os .getenv ("INPUT_EVENTJSON" )
355366 username = os .getenv ("INPUT_SENDERUSERNAME" )
356367 icon = os .getenv ("INPUT_SENDERICONURL" )
357368 actionRepo = os .getenv ("GITHUB_ACTION_REPOSITORY" )
You can’t perform that action at this time.
0 commit comments