Skip to content

Commit

Permalink
Fix hard links creation
Browse files Browse the repository at this point in the history
  • Loading branch information
acocheo committed Sep 15, 2023
1 parent 830c127 commit 33af9af
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .github/hooks/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

# Restore hard links
cp -rfl {workflows,actions,configurations} .github/
4 changes: 0 additions & 4 deletions .github/hooks/pre-commit

This file was deleted.

15 changes: 8 additions & 7 deletions README.dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ Otherwise you can simply open an issue.

## 📖 Setup
CI files of base directory must be *hard linked* in the `.github/.github` folder, so they can be tested.
Since GitHub is not able to store the fact that these files are hardlink, you need to restore it executing [this script](.github/hooks/pre-commit) at every checkout.
A `pre-commit` hook has been made to do it automatically:
Since GitHub is not able to store the fact that these files are hardlink, you need to restore it executing [this script](.github/hooks/post-merge) at every checkout.
From project root:
```bash
.github/hooks/post-merge
```
cd .git/hooks
ln -s ../../.github/hooks/pre-commit
First time is mandatory, then a `post-merge` hook has been made to do it automatically:
```
Alternatively you can execute the script manually every time you need. From project root:
```bash
GIT_DIR=.git .github/hooks/pre-commit
cd .git/hooks
ln -s ../../.github/hooks/post-merge
```
Alternatively you can execute the script manually every time you need.
Now all changes will be linked and be tested with [*test* project](.github/test/) on every PR.
**Note:** Links are for the single files. If you add directories, move or add files, you need to re-execute (or even modify) the script.

Expand Down

0 comments on commit 33af9af

Please sign in to comment.