feat(action): add ca_bundle input for custom CA certificates on self-hosted runners - #1300
Draft
GG-HH wants to merge 2 commits into
Draft
feat(action): add ca_bundle input for custom CA certificates on self-hosted runners#1300GG-HH wants to merge 2 commits into
GG-HH wants to merge 2 commits into
Conversation
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>
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ca_bundleinput toactions/secret/action.ymlthat accepts a path to a CA bundle file relative to the repository rootINPUT_CA_BUNDLE→REQUESTS_CA_BUNDLEindocker/actions-secret-entrypoint.shbeforeggshieldstarts, so all HTTPS requests honour the provided CAMotivation
Self-hosted runners that route HTTPS traffic through a corporate proxy or firewall present a CA certificate not included in the
python:3.10-slimtrust store baked into the action image. This causes ggshield to fail withCERTIFICATE_VERIFY_FAILEDon 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 passtest_ssl_fails_without_ca_bundleconfirms SSL fails when no CA bundle is settest_ssl_succeeds_with_ca_bundleconfirms SSL succeeds whenINPUT_CA_BUNDLE=ca.crtis setopensslare not availableUsage
🤖 Generated with Claude Code