Skip to content

feat(action): add ca_bundle input for custom CA certificates on self-hosted runners - #1300

Draft
GG-HH wants to merge 2 commits into
mainfrom
henri/action-ca-bundle-support
Draft

feat(action): add ca_bundle input for custom CA certificates on self-hosted runners#1300
GG-HH wants to merge 2 commits into
mainfrom
henri/action-ca-bundle-support

Conversation

@GG-HH

@GG-HH GG-HH commented Jun 17, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a new optional ca_bundle input to actions/secret/action.yml that accepts a path to a CA bundle file relative to the repository root
  • Maps INPUT_CA_BUNDLEREQUESTS_CA_BUNDLE in docker/actions-secret-entrypoint.sh before ggshield starts, so all HTTPS requests honour the provided CA
  • Adds two functional tests that spin up a real local HTTPS server signed by a custom CA and verify the fix end-to-end inside the actual Docker container

Motivation

Self-hosted runners that route HTTPS traffic through a corporate proxy or firewall present a CA certificate not included in the python:3.10-slim trust store baked into the action image. This causes ggshield to fail with CERTIFICATE_VERIFY_FAILED on every run. Providing a CA bundle path resolves this without requiring users to rebuild the image.

Test plan

  • uv run --with pytest pytest tests/functional/test_github_action_ca_bundle.py -v — both tests pass
  • test_ssl_fails_without_ca_bundle confirms SSL fails when no CA bundle is set
  • test_ssl_succeeds_with_ca_bundle confirms SSL succeeds when INPUT_CA_BUNDLE=ca.crt is set
  • Tests are skipped automatically if Docker or openssl are not available

Usage

- uses: GitGuardian/ggshield-action@v1
  with:
    ca_bundle: certs/corporate-ca.crt
  env:
    GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}

🤖 Generated with Claude Code

GG-HH and others added 2 commits June 17, 2026 14:49
Adds two integration tests that spin up a local HTTPS server signed by a
custom CA and verify Docker container behaviour:
- without INPUT_CA_BUNDLE → SSL handshake fails as expected
- with INPUT_CA_BUNDLE set → SSL succeeds via REQUESTS_CA_BUNDLE

Tests skip automatically if Docker or openssl are unavailable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…hosted runners

Declares a new optional `ca_bundle` input in actions/secret/action.yml.
GitHub Actions automatically exposes it as INPUT_CA_BUNDLE inside the
container. The entrypoint maps it to REQUESTS_CA_BUNDLE before exec-ing
ggshield, so the requests library uses the provided CA bundle for all
HTTPS calls.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@GG-HH GG-HH self-assigned this Jun 17, 2026
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.51%. Comparing base (158ff03) to head (dda3649).
⚠️ Report is 25 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1300   +/-   ##
=======================================
  Coverage   93.51%   93.51%           
=======================================
  Files         189      189           
  Lines       11081    11081           
=======================================
  Hits        10362    10362           
  Misses        719      719           
Flag Coverage Δ
unittests 93.51% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant