From 65adb8bea615cee34fe5b9b302344a4cebb28e75 Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Wed, 11 Sep 2024 15:35:11 -0600 Subject: [PATCH 1/2] Add fix for dubious ownership, from https://github.com/10up/action-wordpress-plugin-deploy/issues/116 --- build-zip.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build-zip.sh b/build-zip.sh index 969a4c1..08a8884 100755 --- a/build-zip.sh +++ b/build-zip.sh @@ -51,6 +51,11 @@ if [[ "$BUILD_DIR" = false ]]; then TMP_DIR="${HOME}/archivetmp" mkdir "$TMP_DIR" + # Workaround for: detected dubious ownership in repository at '/github/workspace' issue. + # See: https://github.com/10up/action-wordpress-plugin-deploy/issues/116 + # Mark github workspace as safe directory. + git config --global --add safe.directory "$GITHUB_WORKSPACE" + git config --global user.email "10upbot+github@10up.com" git config --global user.name "10upbot on GitHub" From e225098eb043adfd8dca5b954f76ebb9a763568d Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Wed, 11 Sep 2024 15:35:36 -0600 Subject: [PATCH 2/2] Add fix for missing changed files, from https://github.com/10up/action-wordpress-plugin-deploy/pull/130 --- build-zip.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build-zip.sh b/build-zip.sh index 08a8884..988109b 100755 --- a/build-zip.sh +++ b/build-zip.sh @@ -59,6 +59,14 @@ if [[ "$BUILD_DIR" = false ]]; then git config --global user.email "10upbot+github@10up.com" git config --global user.name "10upbot on GitHub" + # Ensure git archive will pick up any changed files in the directory. + # See https://github.com/10up/action-wordpress-plugin-deploy/pull/130 + test $(git ls-files --deleted) && git rm $(git ls-files --deleted) + if [ -n "$(git status --porcelain --untracked-files=all)" ]; then + git add . + git commit -m "Include build step changes" + fi + # If there's no .gitattributes file, write a default one into place if [[ ! -e "$GITHUB_WORKSPACE/.gitattributes" ]]; then cat > "$GITHUB_WORKSPACE/.gitattributes" <<-EOL