Skip to content

Commit

Permalink
chore: ignore various files & move hidden files from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
ccloli committed Dec 14, 2023
1 parent 0115ec9 commit d00978a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/daily-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ jobs:
git fetch upstream
# check if upstream has changed
if [[ $(git diff upstream/main ${last_hash} -- apps/playground) ]]; then
upstream_changes=$(git diff upstream/main ${last_hash} -- apps/playground)
echo "::debug::${upstream_changes}"
if [[ $upstream_changes ]]; then
echo "upstream_changed=true" >> $GITHUB_OUTPUT
echo "Files changed in apps/playground"
else
Expand All @@ -62,18 +64,17 @@ jobs:
# get changed files
# changed=$(git diff ${last_hash} -- apps/playground ./*)
# git diff upstream/main -- apps/playground/* HEAD -- ./* | sed -e "s|apps/playground/||g" > changed.diff
git diff ${last_hash}:apps/playground/ HEAD | sed -e "s|apps/playground/||g" > changed.diff
git diff ${last_hash}:apps/playground/ HEAD -- . ':!README.md' ':!package-lock.json' ':!.github' | sed -e "s|apps/playground/||g" > changed.diff
echo "::debug::$(cat changed.diff)"
# reset related files to upstream
git restore --source upstream/main apps/playground
rm -rf ./src ./config
mv apps/playground/* ./ -f
rm -rf apps/playground/
git add .
mv apps/playground/{.*,*} ./ -f -v
rm -rf ./apps
# apply changes
git apply ./changed.diff --exclude=README.md --reject
git apply ./changed.diff --reject
rm ./changed.diff
# check if all files are patched without any conflicts
Expand Down Expand Up @@ -115,7 +116,7 @@ jobs:
git push
echo "push_success=true" >> $GITHUB_OUTPUT
echo "::debug::Commit has been pushed successfully"
echo "Commit has been pushed successfully"
deploy:
needs: sync_upstream
Expand Down

0 comments on commit d00978a

Please sign in to comment.