From bf43d89aee716cfbe7d72ae18eb5eaa313541746 Mon Sep 17 00:00:00 2001 From: Eric Theise Date: Fri, 13 Sep 2024 07:42:32 +0200 Subject: [PATCH] Re: https://github.com/OpenHistoricalMap/issues/issues/885, preserving upstream docs. --- .github/workflows/ohm.upstream-sync.yml | 12 ++++++------ scripts/ohm/preserve_upstream_docs.sh | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 6 deletions(-) create mode 100755 scripts/ohm/preserve_upstream_docs.sh diff --git a/.github/workflows/ohm.upstream-sync.yml b/.github/workflows/ohm.upstream-sync.yml index 4041c1d6d6..417fb0627a 100644 --- a/.github/workflows/ohm.upstream-sync.yml +++ b/.github/workflows/ohm.upstream-sync.yml @@ -4,7 +4,7 @@ on: push: branches: 885-ci-for-tasking-manager # schedule: -# - cron: "34 12 * * *" +# - cron: '34 12 * * *' workflow_dispatch: jobs: @@ -45,9 +45,9 @@ jobs: env: UPSTREAM: https://github.com/tyrasd/overpass-turbo run: | - git config --global user.name "github-actions" - git config --global user.email "github-actions@users.noreply.github.com" - git remote add upstream "${UPSTREAM}" + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@users.noreply.github.com' + git remote add upstream '${UPSTREAM}' git fetch upstream master - name: List all branches @@ -61,12 +61,12 @@ jobs: with: branch: 'the-sacrifice' - - name: Check out 'release-candidate', our new sacrificial branch + - name: Check out our new sacrificial branch uses: actions/checkout@v4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - ref: "the-sacrifice" + ref: 'the-sacrifice' fetch-depth: 0 - name: List all branches diff --git a/scripts/ohm/preserve_upstream_docs.sh b/scripts/ohm/preserve_upstream_docs.sh new file mode 100755 index 0000000000..45a5880d59 --- /dev/null +++ b/scripts/ohm/preserve_upstream_docs.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +if [ ! -d "upstream" ]; then + mkdir upstream +fi +for i in $(git ls-tree upstream/master --name-only); do + if [[ $i == *.md ]];then + echo $i + git show upstream/master:$i > upstream/$i + fi +done +git show upstream/master:LICENSE.txt > upstream/LICENSE +git add upstream +if [ -n "$(git status --porcelain)" ]; then + git commit -m 'Preserving upstream markdown & text files.' +fi