Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ inputs:
verify_ssl:
description: 'Optional. Set to false to disable verification of SSL certificates.'
default: true
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:
Expand All @@ -37,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'
Expand Down
12 changes: 12 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ if [ -n "$VERIFY_SSL" ]; then
verify_ssl=$VERIFY_SSL
fi

if [ -n "$BASE64_ENCODED_CA_BUNDLE" ]; then
base64_encoded_ca_bundle=$BASE64_ENCODED_CA_BUNDLE
fi

if [ -n "$TIMEOUT" ]; then
timeout=$TIMEOUT
fi
Expand Down Expand Up @@ -196,6 +200,11 @@ if [ "$verify_ssl" = false ]; then
options="$options -k"
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"
fi

if [ -n "$timeout" ]; then
options="$options --connect-timeout $timeout"
fi
Expand Down Expand Up @@ -308,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
Expand Down