Fix running git commands in CI tests under GitHub Actions#1397
Merged
Conversation
|
Kudos, SonarCloud Quality Gate passed!
|
Codecov ReportBase: 71.17% // Head: 71.35% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1397 +/- ##
============================================
+ Coverage 71.17% 71.35% +0.18%
Complexity 1650 1650
============================================
Files 32 32
Lines 3788 3774 -14
============================================
- Hits 2696 2693 -3
+ Misses 1092 1081 -11
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.








Reasons for creating this PR
GitHub Actions CI builds are currently failing because some tests are executing git commands, but git refuses to run because of a "dubious ownership" error. The error happens because the PHPUnit tests are run within a container as the root user, but the /app directory is owned by another user (uid 1001).
Here is
whoamiunder the container:Here is
ls -l /app:Link to relevant issue(s), if any
Description of the changes in this PR
The PR fixes the problem by first creating the directory
/home/runnerwhich doesn't exist within the container, even though it is the value of theHOMEenvironment variable. Then it executes the commandgit config --global --add safe.directory /app, which will preventgitfrom complaining about dubious ownership; this will be stored in the configuration file/home/runner/.gitconfigwhere subsequent git commands (run from PHPUnit tests) will see it.Known problems or uncertainties in this PR
n/a
Checklist
.sr-onlyclass, color contrast)