From 7497809ee927be94d8911f8b52f770c85bbb6c87 Mon Sep 17 00:00:00 2001 From: Ted John Date: Wed, 8 Jan 2020 19:32:46 +0000 Subject: [PATCH] Add localisation merge workflow (#10538) --- .github/workflows/localisation.yml | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/localisation.yml diff --git a/.github/workflows/localisation.yml b/.github/workflows/localisation.yml new file mode 100644 index 0000000000..6d88a72065 --- /dev/null +++ b/.github/workflows/localisation.yml @@ -0,0 +1,44 @@ +name: Localisation Merge +on: + schedule: + - cron: '0 4 * * *' +jobs: + merge-localisation: + name: Merge Localisation + runs-on: ubuntu-latest + steps: + - name: Store private SSH + run: | + echo "Store private SSH deploy key..." + mkdir -p ~/.ssh + echo "${{ secrets.OPENRCT2_DEPLOY_KEY }}" > ~/.ssh/id_rsa + chmod 700 ~/.ssh + chmod 600 ~/.ssh/id_rsa + - name: Clone repositories + run: | + echo "Cloning repositories..." + git clone -b master git@github.com:OpenRCT2/Localisation.git Localisation + git clone -b develop git@github.com:OpenRCT2/OpenRCT2.git OpenRCT2 + - name: Copy over language files + run: | + echo "Copying language files..." + for f in ./Localisation/data/language/* + do + filename=$(basename $f) + cp $f "./OpenRCT2/data/language/$filename" + done + - name: Commit and push + run: | + pushd ./OpenRCT2 + if [[ $(git status -s) ]]; then + echo "Committing and pushing..." + git add . + git config --global user.name "OpenRCT2 git bot" + git config --global user.email "gitbot@openrct2.org" + git commit -m "Merge Localisation/master into OpenRCT2/develop." + git push + echo "Complete" + else + echo "No changes to merge." + fi + popd