From a764ad4c6b5a040148a7be0b7320f45c20c029f5 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Thu, 5 Mar 2020 10:44:19 +0000 Subject: [PATCH] :construction_worker_man: sync DINAR Pushed from https://github.com/itpp-labs/DINAR/.github/workflows/fork2repos.yml --- .github/workflows/repo2store.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/repo2store.yml diff --git a/.github/workflows/repo2store.yml b/.github/workflows/repo2store.yml new file mode 100644 index 0000000..2ed833c --- /dev/null +++ b/.github/workflows/repo2store.yml @@ -0,0 +1,32 @@ +name: "Push Updates to REPO-store" + +on: + push: + +jobs: + repo2store: + runs-on: ubuntu-latest + if: "! endsWith(github.repository, '-store')" + steps: + - name: Checkout REPO + uses: actions/checkout@v2-beta + with: + fetch-depth: 100 + # custom token is not needed for fetching REPO, + # but the action makes some magic with authentication headers + # which are used on pushing to REPO-store + token: ${{ secrets.DINAR_TOKEN }} + - name: Fetch REPO-store + run: | + git remote add store https://x-access-token:${{ secrets.DINAR_TOKEN }}@github.com/${GITHUB_REPOSITORY}-store.git + git fetch store + - name: Merge and Push + run: | + set -x + git config --global user.email "itpp-bot@users.noreply.github.com" + git config --global user.name "Mitchell Admin" + BRANCH=${GITHUB_REF##*/} + REF=$(git rev-parse HEAD) + git checkout -b $BRANCH-store store/$BRANCH + git merge origin/$BRANCH $REF + git push store $BRANCH-store:$BRANCH