feat: add http_headers input for custom header injection

Allows users to pass custom HTTP headers (e.g. for Cloudflare
Access) via a comma-separated action input, which get forwarded
as --http-header flags to the CLI.
This commit is contained in:
Vignesh-285 2026-04-16 22:12:31 +05:30
parent 57e3a136b7
commit 053612a7d8
No known key found for this signature in database
GPG key ID: D1F52E54E3E49ADE
2 changed files with 10 additions and 0 deletions

View file

@ -79,6 +79,9 @@ inputs:
description: 'If no coverage reports are found, do not raise an exception.'
required: false
default: 'false'
http_headers:
description: 'Extra HTTP headers to send with every request, one per line (format: Header-Name:Value).'
required: false
job_code:
description: ''
required: false
@ -331,6 +334,7 @@ runs:
CC_GCOV_INCLUDE: ${{ inputs.gcov_include }}
CC_GIT_SERVICE: ${{ inputs.git_service }}
CC_HANDLE_NO_REPORTS_FOUND: ${{ inputs.handle_no_reports_found }}
CC_HTTP_HEADERS: ${{ inputs.http_headers }}
CC_JOB_CODE: ${{ inputs.job_code }}
CC_LEGACY: ${{ inputs.use_legacy_upload_endpoint }}
CC_NAME: ${{ inputs.name }}

6
dist/codecov.sh vendored
View file

@ -155,6 +155,12 @@ then
fi
CC_CLI_ARGS+=( $(write_bool_args CC_DISABLE_TELEM) )
CC_CLI_ARGS+=( $(write_bool_args CC_VERBOSE) )
if [ -n "$CC_HTTP_HEADERS" ]; then
while IFS= read -r header; do
[ -z "$header" ] && continue
CC_CLI_ARGS+=( "--http-header" "$header" )
done <<< "$CC_HTTP_HEADERS"
fi
CC_ARGS=()
if [ "$CC_RUN_CMD" == "upload-coverage" ]; then
# Args for create commit