Skip to content

Commit ce9a8cb

Browse files
committed
fix: set workspace directory as safe in the entrypoint
`actions/checkout` already fixed the issue on their side in [v3.0.1](https://github.com/actions/checkout/releases/tag/v3.0.1). But since this is a container action, it can be run with another uid than the one from `actions/checkout` and therefore we need to add the `safe.directory` config again. Another way of fixing this would be to make this action run with the same uid as the github runner, but as mentioned [here](actions/checkout#760 (comment)) we're not sure whether the `1000` uid of the runner is reliable. The different `uid` issue seems more like a Github Actions ecosystem problem, maybe they'll take care of it later.
1 parent 534ab20 commit ce9a8cb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
commitlint:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1818
with:
1919
fetch-depth: 0
2020
- uses: wagoid/commitlint-github-action@v4
@@ -134,7 +134,7 @@ jobs:
134134
commitlint:
135135
runs-on: ubuntu-latest
136136
steps:
137-
- uses: actions/checkout@v2
137+
- uses: actions/checkout@v3
138138
with:
139139
fetch-depth: 0
140140
- uses: actions/setup-node@v2

entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ else
88
export NODE_PATH=$NODE_PATH:/node_modules
99
fi
1010

11+
# Since actions/checkout can be setup with a different user ID, we need to set the workspace as safe inside this action
12+
# Info about the vunlerability: https://github.blog/2022-04-12-git-security-vulnerability-announced/
13+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
14+
1115
node /run.js

0 commit comments

Comments
 (0)