Skip to content

Commit

Permalink
Part of OpenHistoricalMap/issues#786, adjusting workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
erictheise committed Jul 11, 2024
1 parent b6c4800 commit 3cc55fb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/ohm.upstream-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ jobs:
run:
shell: bash
steps:
- name: Create sacrificial branch
- name: Delete previous sacrificial branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git branch -D 'the-sacrifice'
- name: Create new sacrificial branch
uses: peterjgrainger/[email protected]
with:
branch: 'the-sacrifice'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check out our repository
- name: Check main out to sacrificial branch
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: 'the-sacrifice'
- name: Check out the upstream repository
- name: Check out upstream master
env:
UPSTREAM: https://github.com/tyrasd/overpass-turbo
run: |
Expand Down
33 changes: 17 additions & 16 deletions scripts/upstream_sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@ fi
git status

git merge --no-ff --no-commit upstream/master
#concerns=('js/ide.js' 'js/map.ts')
#for i in $(git diff --name-only --diff-filter=U --relative);do
# echo "$i"
# for c in "${concerns[@]}";do
# echo "$c"
# if [[ $i != $c ]];then
# git checkout --theirs -- $i
# git add $i
# fi
# done
#done
#
#if [ -n "$(git status --porcelain)" ]; then
# iso=$(date -Iminutes)
# git commit -m "Merge upstream ("$iso")."
#fi
concerns=('js/ide.js' 'js/map.ts')
for i in $(git diff --name-only --diff-filter=U --relative);do
echo "$i"
for c in "${concerns[@]}";do
echo "$c"
if [[ $i != $c ]];then
git checkout --theirs -- $i
git add $i
fi
done
done

if [ -n "$(git status --porcelain)" ]; then
iso=$(date -Iminutes)
git commit -m "Merge upstream ("$iso")."
fi
git push origin the-sacrifice

0 comments on commit 3cc55fb

Please sign in to comment.