forked from tyrasd/overpass-turbo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addresses OpenHistoricalMap/issues#786 by adding a new workflow and a…
…ssociated bash script.
- Loading branch information
1 parent
4d08875
commit 1c07ace
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Upstream Sync | ||
|
||
on: | ||
schedule: | ||
- cron: "20 5,17 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
upstream-sync: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./scripts | ||
steps: | ||
- name: Check out the repository to the runner | ||
uses: actions/checkout@v4 | ||
- name: Make the script files executable | ||
run: chmod +x upstream_sync.sh | ||
- name: Run sync script | ||
uses: upstream_sync.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# | ||
# | ||
|
||
git checkout main | ||
git branch -D the-sacrifice | ||
git checkout -b the-sacrifice | ||
git fetch upstream master | ||
|
||
mkdir upstream | ||
for i in $(git ls-tree upstream/master --name-only); do | ||
if [[ $i == *.md ]];then | ||
git show upstream/master:$i > upstream/$i | ||
fi | ||
done | ||
git show upstream/master:LICENSE > upstream/LICENSE | ||
git add upstream | ||
git commit -m 'Preserving upstream markdown & text files.' | ||
|
||
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 | ||
|
||
iso=$(date -Iminutes) | ||
git commit -m "Merge upstream ("$iso")." |