mirror of
https://github.com/codecov/codecov-action.git
synced 2026-05-23 19:05:53 +00:00
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:
parent
57e3a136b7
commit
053612a7d8
2 changed files with 10 additions and 0 deletions
|
|
@ -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
6
dist/codecov.sh
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue