Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
sync_approved_pr: Fix git safe directory issue
Browse files Browse the repository at this point in the history
- while initialising git repo in docker container
  • Loading branch information
laukik-hase committed Feb 3, 2023
1 parent c71449a commit d912ce4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions github_pr_to_internal_pr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ RUN apt-get update && \
pip3 install --upgrade pip && \
pip3 install -r /tmp/requirements.txt

# Changing the ownership of the repository after checking out
# Error: fatal: detected dubious ownership in repository at '/github/workspace'
# To add an exception for this directory, call:
# git config --global --add safe.directory /github/workspace
# Reason: Recent versions of git require the .git folder to be owned
# by the same user (see https://github.blog/2022-04-12-git-security-vulnerability-announced/).
# Related
# - https://github.com/actions/runner/issues/2033
# - https://github.com/actions/checkout/issues/1048
# - https://github.com/actions/runner-images/issues/6775
RUN chown -R $(id -u):$(id -g) $PWD

COPY github_pr_to_internal_pr.py /

ENTRYPOINT ["/usr/bin/python3", "/github_pr_to_internal_pr.py"]

0 comments on commit d912ce4

Please sign in to comment.