Commit 1114aed
committed
Disable Git safe directory check
I noticed that `zip` was used instead of `git archive` GitHub workflows
and traced it to this line in `pgxn-bundle`:
```sh
if [ "true" == "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then
```
Removing the STDERR redirect revealed this error:
``` text
fatal: detected dubious ownership in repository at '/repo'
To add an exception for this directory, call:
git config --global --add safe.directory /repo
```
PR #6 (aac074a) tried to fix it by setting the safe directory in
`.entrypoint.sh`, and included tests that replicated the issue.
Unfortunately it turns out that using the GitHub workflow [`container`
syntax] skips the entrypoint, so it didn't work.
Further research turned up [this SO answer], which reveals that the
check can be disabled run setting the `safe.directory` to `'*'`. So add
this command to the `Dockerfile`:
```sh
git config --system --add safe.directory '*'
```
This disables the check system-wide in the container by putting the
configuration into `/etc/gitconfig`. This persists into the running
container, of course, letting any user in the container run Git on files
it doesn't own --- in this case, `pgxn-bundle`'s `git archive` command.
Resolves #5.
[`container` syntax]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idcontainer
[this SO answer]: https://stackoverflow.com/a/73100228/792021 parent 74933e5 commit 1114aed
2 files changed
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | 5 | | |
10 | 6 | | |
11 | 7 | | |
| |||
0 commit comments