fix(ci): skip OTel export job on fork PRs - #239
Conversation
External-contributor (fork) PRs do not receive repository secrets, so secrets.OTLP_ENDPOINT is empty. The otel-cicd-action then builds the endpoint as '/v1/traces' (no host), falls into the gRPC exporter path, and fails with 'Name resolution failed for target dns:v1'. Guard the OpenTelemetry Export Trace job so it only runs for same-repo events (push, internal PRs, schedule) and skips on fork PRs. Add a step-level env guard as defense-in-depth so an empty endpoint never reaches the action even on same-repo runs where the secret is unset. This job is not a required check, so this only removes the spurious red status on external-contributor PRs; it does not change merge gating.
|
Deep Review✅ No critical issues found. The job-level guard correctly evaluates for every trigger — 🟡 P2 — recommended
🔵 P3 nitpicks (3)
Reviewers (6): correctness, security, reliability, maintainability, testing, project-standards. Testing gaps: Workflow conditional logic is only observable via live runs — no fork-PR run was shown confirming the job reports skipped (not failed); the silent-skip path on a same-repo run with an empty endpoint produces a green job indistinguishable from a successful export, so a stopped trace pipeline would go unnoticed without an external "traces arriving" check. |
Fixes the spurious red
OpenTelemetry Export Tracejob failure that appears on every external-contributor (fork) PR.Problem
chart-test.ymlruns onpull_request. GitHub withholds repository secrets from fork PRs, sosecrets.OTLP_ENDPOINTis empty. The workflow builds the endpoint as${{ secrets.OTLP_ENDPOINT }}/v1/traces, which collapses to just/v1/traces(no host). Thecorentinmusard/otel-cicd-actionthen falls into its gRPC exporter branch and fails:Example failing run (fork PR #234, head repo
mfroembgen/ClickStack-helm-charts):https://github.com/ClickHouse/ClickStack-helm-charts/actions/runs/28361825424/job/84189297741
Updating the secret value does not help — no secret reaches a fork PR run.
Fix
push, internal PRs,schedule,workflow_dispatch); skip it on fork PRs viagithub.event.pull_request.head.repo.full_name == github.repository.always()is preserved so failure traces still export on internal runs.OTLP_ENDPOINTinto a jobenvand gate the step onenv.OTLP_ENDPOINT !=, so an empty endpoint never reaches the action even on a same-repo run where the secret happens to be unset. (secrets.*is not allowed in a step-levelif, hence theenvindirection.)Impact
This job is not a required status check, so this change only removes the noisy ❌ on external-contributor PRs — it does not alter merge gating. Internal runs continue exporting CI traces unchanged.
Testing
python3 -c "import yaml; yaml.safe_load(...)"— YAML parses.github.*in jobif,env.*in stepif).