Skip to content

Commit bf743e0

Browse files
authored
Another fix for git perms
1 parent bcf3dc6 commit bf743e0

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

.github/workflows/linux.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ on:
4242
- 'Telegram/Telegram.plist'
4343

4444
jobs:
45-
4645
linux:
4746
name: Rocky Linux 8
4847
runs-on: self-hosted
@@ -58,24 +57,29 @@ jobs:
5857

5958
steps:
6059

61-
- name: Trust CI working directory
62-
run: |
63-
git config --global --add safe.directory "$GITHUB_WORKSPACE"
64-
6560
- name: Get repository name
6661
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
6762

68-
- name: Clone repository
63+
- name: Clone repository with submodules
6964
uses: actions/checkout@v4
7065
with:
7166
submodules: recursive
7267
path: ${{ env.REPO_NAME }}
73-
74-
- name: Reset project permissions
68+
69+
- name: Trust repository and submodules
7570
run: |
76-
cd ${{ env.REPO_NAME }}; git submodule deinit -f .
77-
cd ${{ env.REPO_NAME }}; git submodule update --init --recursive --depth=1
78-
71+
find "${{ github.workspace }}/${{ env.REPO_NAME }}" -type d -name ".git" | while read gitdir; do
72+
safe_dir=$(dirname "$gitdir")
73+
echo "Adding safe.directory: $safe_dir"
74+
git config --global --add safe.directory "$safe_dir"
75+
done
76+
77+
- name: Reset project permissions and update submodules
78+
run: |
79+
cd "${{ env.REPO_NAME }}"
80+
git submodule deinit -f .
81+
git submodule update --init --recursive --depth=1
82+
7983
- name: Install jinja2-cli
8084
run: |
8185
pip install --user jinja2-cli

0 commit comments

Comments
 (0)