feat: Inject runtime configuration for GH_APP in NGINX startup script#3962
feat: Inject runtime configuration for GH_APP in NGINX startup script#3962jason-ford-codecov wants to merge 3 commits intomainfrom
Conversation
|
@sentry review |
docker/start-nginx.sh
Outdated
| # Inject runtime config via window.configEnv | ||
| if [[ -n "${CODECOV_GH_APP}" ]]; then | ||
| echo "Setting GH_APP to ${CODECOV_GH_APP}" | ||
| sed -i 's|<head>|<head><script>window.configEnv=window.configEnv||{};window.configEnv.GH_APP="'"${CODECOV_GH_APP}"'";</script>|' /var/www/app/gazebo/index.html |
There was a problem hiding this comment.
Unescaped special characters in env variable break sed
Medium Severity
The ${CODECOV_GH_APP} value is inserted directly into the sed replacement without escaping special characters. In sed replacement text, & means "insert matched pattern," so a value like my&app becomes my<head>app. Additionally, values containing ", \, or </script> would break the JavaScript syntax or HTML structure. The environment variable value needs to be sanitized or escaped before being used in the sed command.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3962 +/- ##
=======================================
Coverage 98.73% 98.73%
=======================================
Files 826 826
Lines 14983 14983
Branches 4287 4287
=======================================
Hits 14793 14793
Misses 182 182
Partials 8 8
Continue to review full report in Codecov by Sentry.
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #3962 +/- ##
=======================================
Coverage 98.73% 98.73%
=======================================
Files 826 826
Lines 14983 14983
Branches 4292 4287 -5
=======================================
Hits 14793 14793
Misses 182 182
Partials 8 8
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3962 +/- ##
=======================================
Coverage 98.73% 98.73%
=======================================
Files 826 826
Lines 14983 14983
Branches 4287 4292 +5
=======================================
Hits 14793 14793
Misses 182 182
Partials 8 8
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
@sentry review |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #3962 +/- ##
==========================================
+ Coverage 95.34% 98.73% +3.39%
==========================================
Files 826 826
Lines 14983 14983
Branches 4287 4292 +5
==========================================
+ Hits 14285 14793 +508
+ Misses 618 182 -436
+ Partials 80 8 -72 see 54 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
@sentry review |
Bundle ReportBundle size has no change ✅ |
Description
This enables changing the github app url from the env
Code Example
Notable Changes
Screenshots
Link to Sample Entry
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
Note
Adds runtime configuration injection for the GitHub App.
docker/start-nginx.shto injectwindow.configEnv.GH_APPintogazebo/index.htmlifCODECOV_GH_APPis setWritten by Cursor Bugbot for commit fb8f75a. This will update automatically on new commits. Configure here.