Skip to content

Commit

Permalink
.copr: Replace chown call with standard workflow safe.directory setting
Browse files Browse the repository at this point in the history
As a user this isn't necessary, and potentially dangerous when running
this as root. This is a workaround which is specific to running
containers in GitHub workflows, so configure git there.
  • Loading branch information
martinpitt committed Aug 2, 2023
1 parent 3b2807f commit 3845400
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .copr/make-srpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ EXPANDER_URL=https://github.com/fedora-selinux/macro-expander

rpm -q rpm-build git-core

# Ensure that the git directory is owned by us to appease Git's
# anti-CVE-2022-24765 measures.
chown $(id -u):$(id -g) "$rootdir"

base_head_id="$(git -C "$rootdir" rev-parse HEAD)"
base_short_head_id="${base_head_id:0:7}"
base_date="$(TZ=UTC git show -s --format=%cd --date=format-local:%F_%T HEAD | tr -d :-)"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
steps:
- run: dnf install --nogpgcheck -y make git-core rpm-build 'dnf-command(builddep)'
- uses: actions/checkout@v2
# https://github.blog/2022-04-12-git-security-vulnerability-announced/
- run: git config --global --add safe.directory /__w/
- run: make -C .copr srpm outdir="$PWD"
- name: Store the SRPM as an artifact
uses: actions/upload-artifact@v2
Expand Down

0 comments on commit 3845400

Please sign in to comment.