Philipp
scheduled this pull request to auto merge when all checks succeed 2025-12-31 18:54:45 +01:00
AutoReview
changed title from fix: pre-commit hooks should now be installable in dev containers to Fix Git hooks ownership in devcontainer setup2025-12-31 18:54:54 +01:00
Using a relative path for .git/hooks may lead to incorrect directory targeting if the script is run from a different working directory. Consider using an absolute path or ensuring the script’s working directory is the repo root.
The script assumes the .git/hooks directory exists. If .git is not initialized, chown will fail. Add a check to verify the directory before attempting ownership changes.
sudo chown -R node:node .git/hooks
## PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
<table>
<tr><td>⏱️ <strong>Estimated effort to review</strong>: 1 🔵⚪⚪⚪⚪</td></tr>
<tr><td>🧪 <strong>No relevant tests</strong></td></tr>
<tr><td>🔒 <strong>No security concerns identified</strong></td></tr>
<tr><td>⚡ <strong>Recommended focus areas for review</strong><br><br>
<details><summary><a href='https://git.horstenkamp.eu/Screeps/screeps-deploy-action/src/branch/fix-hook-install/.devcontainer/setup.sh#L8-L8'><strong>Relative path usage</strong></a>
Using a relative path for `.git/hooks` may lead to incorrect directory targeting if the script is run from a different working directory. Consider using an absolute path or ensuring the script’s working directory is the repo root.
</summary>
```shell
sudo chown -R node:node .git/hooks
```
</details>
<details><summary><a href='https://git.horstenkamp.eu/Screeps/screeps-deploy-action/src/branch/fix-hook-install/.devcontainer/setup.sh#L8-L8'><strong>Directory existence</strong></a>
The script assumes the `.git/hooks` directory exists. If `.git` is not initialized, `chown` will fail. Add a check to verify the directory before attempting ownership changes.
</summary>
```shell
sudo chown -R node:node .git/hooks
```
</details>
</td></tr>
</table>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
PR Type
Bug fix
Description
Fix
.git/hooksownership in devcontainer setupEnsure pre-commit hooks install correctly
Diagram Walkthrough
File Walkthrough
setup.sh
Add ownership fix for `.git/hooks`.devcontainer/setup.sh
sudo chown -R node:node .git/hooksbefore hook installfix: pre-commit hooks should now be installable in dev containersto Fix Git hooks ownership in devcontainer setupPR Reviewer Guide 🔍
Here are some key observations to aid the review process:
Relative path usage
Using a relative path for
.git/hooksmay lead to incorrect directory targeting if the script is run from a different working directory. Consider using an absolute path or ensuring the script’s working directory is the repo root.Directory existence
The script assumes the
.git/hooksdirectory exists. If.gitis not initialized,chownwill fail. Add a check to verify the directory before attempting ownership changes.PR Code Suggestions ✨