From 295fa8aad74b30112d9020bf32addd1cbe145a4c Mon Sep 17 00:00:00 2001 From: dream2bcoder Date: Sun, 1 Dec 2024 02:14:43 +0530 Subject: [PATCH 01/10] Update entrypoint.sh --- entrypoint.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 109c2c7..90cd0dd 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -61,6 +61,10 @@ if [ -n "$VERIFY_SSL" ]; then verify_ssl=$VERIFY_SSL fi +if [ -n "$CA_BUNDLE" ]; then + ca_bundle=$CA_BUNDLE +fi + if [ -n "$TIMEOUT" ]; then timeout=$TIMEOUT fi @@ -196,6 +200,11 @@ if [ "$verify_ssl" = false ]; then options="$options -k" fi +if [ "$verify_ssl" = true ] && [ -n "$ca_bundle" ]; then + echo $ca_bundle > /ca.crt + options="$options -cacert /ca.crt" +fi + if [ -n "$timeout" ]; then options="$options --connect-timeout $timeout" fi From 6c59363efe2a9727548dcb1cffd13950f6eb5a50 Mon Sep 17 00:00:00 2001 From: dream2bcoder Date: Sun, 1 Dec 2024 02:16:44 +0530 Subject: [PATCH 02/10] Update action.yml --- action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/action.yml b/action.yml index bc23af8..3c8c435 100644 --- a/action.yml +++ b/action.yml @@ -26,6 +26,8 @@ inputs: verify_ssl: description: 'Optional. Set to false to disable verification of SSL certificates.' default: true + ca_bundle: + description: 'Optional. Set to check private/untrustworthy SSL certificates.' event_name: description: 'Optional. Specify a custom event name sent to the webhook endpoint, if not defined it defaults to GITHUB_EVENT_NAME.' data: From 83472700be65151139cf23bf39c642f27b214c0c Mon Sep 17 00:00:00 2001 From: dream2bcoder Date: Sun, 1 Dec 2024 02:25:33 +0530 Subject: [PATCH 03/10] Update action.yml --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 3c8c435..0a2536b 100644 --- a/action.yml +++ b/action.yml @@ -39,8 +39,8 @@ outputs: runs: using: 'docker' - # image: 'Dockerfile' - image: 'docker://ghcr.io/distributhor/workflow-webhook-container:v3.0.8' + image: 'Dockerfile' + # image: 'docker://ghcr.io/distributhor/workflow-webhook-container:v3.0.8' branding: icon: 'terminal' From 8829ce8e88e7f3be1c4ebc0e48c930c3c23567d5 Mon Sep 17 00:00:00 2001 From: dream2bcoder Date: Sun, 1 Dec 2024 03:15:32 +0530 Subject: [PATCH 04/10] Update entrypoint.sh --- entrypoint.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 90cd0dd..3081b31 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -61,8 +61,8 @@ if [ -n "$VERIFY_SSL" ]; then verify_ssl=$VERIFY_SSL fi -if [ -n "$CA_BUNDLE" ]; then - ca_bundle=$CA_BUNDLE +if [ -n "$BASE64_ENCODED_CA_BUNDLE" ]; then + base64_encoded_ca_bundle=$BASE64_ENCODED_CA_BUNDLE fi if [ -n "$TIMEOUT" ]; then @@ -200,9 +200,9 @@ if [ "$verify_ssl" = false ]; then options="$options -k" fi -if [ "$verify_ssl" = true ] && [ -n "$ca_bundle" ]; then - echo $ca_bundle > /ca.crt - options="$options -cacert /ca.crt" +if [ "$verify_ssl" = true ] && [ -n "$base64_encoded_ca_bundle" ]; then + echo $base64_encoded_ca_bundle | base64 --decode > /ca_bundle.crt + options="$options -cacert /ca_bundle.crt" fi if [ -n "$timeout" ]; then From ef7ee2430373312f6e25ac91bd4815d10629f3c6 Mon Sep 17 00:00:00 2001 From: dream2bcoder Date: Sun, 1 Dec 2024 03:16:16 +0530 Subject: [PATCH 05/10] Update action.yml --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 0a2536b..c365c1c 100644 --- a/action.yml +++ b/action.yml @@ -26,8 +26,8 @@ inputs: verify_ssl: description: 'Optional. Set to false to disable verification of SSL certificates.' default: true - ca_bundle: - description: 'Optional. Set to check private/untrustworthy SSL certificates.' + base64_encoded_ca_bundle: + description: 'Optional. Set to check with private/untrustworthy SSL certificates.' event_name: description: 'Optional. Specify a custom event name sent to the webhook endpoint, if not defined it defaults to GITHUB_EVENT_NAME.' data: From 212d5e6caea3144fceaa48b2a8e50867c9a5b2c9 Mon Sep 17 00:00:00 2001 From: dream2bcoder Date: Sun, 1 Dec 2024 03:23:46 +0530 Subject: [PATCH 06/10] Update entrypoint.sh --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 3081b31..68ba066 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -201,7 +201,7 @@ if [ "$verify_ssl" = false ]; then fi if [ "$verify_ssl" = true ] && [ -n "$base64_encoded_ca_bundle" ]; then - echo $base64_encoded_ca_bundle | base64 --decode > /ca_bundle.crt + echo $base64_encoded_ca_bundle | base64 -d > /ca_bundle.crt options="$options -cacert /ca_bundle.crt" fi From d7f76b9f67dfd7bbb6bb1e7503a7d8af58dc1de2 Mon Sep 17 00:00:00 2001 From: dream2bcoder Date: Sun, 1 Dec 2024 03:28:06 +0530 Subject: [PATCH 07/10] Update entrypoint.sh --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 68ba066..38689f4 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -202,7 +202,7 @@ fi if [ "$verify_ssl" = true ] && [ -n "$base64_encoded_ca_bundle" ]; then echo $base64_encoded_ca_bundle | base64 -d > /ca_bundle.crt - options="$options -cacert /ca_bundle.crt" + options="$options --cacert /ca_bundle.crt" fi if [ -n "$timeout" ]; then From 49ee26f10d7d9686dc7ab775e55e79e0fa1fc774 Mon Sep 17 00:00:00 2001 From: dream2bcoder Date: Sun, 1 Dec 2024 15:09:09 +0530 Subject: [PATCH 08/10] Update entrypoint.sh --- entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/entrypoint.sh b/entrypoint.sh index 38689f4..2d0c32b 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -202,6 +202,7 @@ fi if [ "$verify_ssl" = true ] && [ -n "$base64_encoded_ca_bundle" ]; then echo $base64_encoded_ca_bundle | base64 -d > /ca_bundle.crt + cat /ca_bundle.crt options="$options --cacert /ca_bundle.crt" fi From 0e1f29b8be1107b35194ffd638ec51ef7618a51a Mon Sep 17 00:00:00 2001 From: dream2bcoder Date: Sun, 1 Dec 2024 15:30:34 +0530 Subject: [PATCH 09/10] Update entrypoint.sh --- entrypoint.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 2d0c32b..38689f4 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -202,7 +202,6 @@ fi if [ "$verify_ssl" = true ] && [ -n "$base64_encoded_ca_bundle" ]; then echo $base64_encoded_ca_bundle | base64 -d > /ca_bundle.crt - cat /ca_bundle.crt options="$options --cacert /ca_bundle.crt" fi From de2737d2a5a4b66d32c8a19c0671e3d649278b41 Mon Sep 17 00:00:00 2001 From: dream2bcoder Date: Sun, 1 Dec 2024 19:22:12 +0530 Subject: [PATCH 10/10] Update entrypoint.sh --- entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 38689f4..59f190c 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -317,6 +317,9 @@ fi # response=$(curl $options $auth_header $headers --data "$WEBHOOK_DATA" $WEBHOOK_ENDPOINT) +# cleanup certificate payload +rm -rf /ca_bundle.crt + CURL_STATUS=$? # echo "response-body=$response" >> $GITHUB_OUTPUT