You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.1 KiB

  1. name: "Push Updates to REPO-store"
  2. on:
  3. push:
  4. jobs:
  5. repo2store:
  6. runs-on: ubuntu-latest
  7. if: "! endsWith(github.repository, '-store')"
  8. steps:
  9. - name: Checkout REPO
  10. uses: actions/checkout@v2-beta
  11. with:
  12. fetch-depth: 100
  13. # custom token is not needed for fetching REPO,
  14. # but the action makes some magic with authentication headers
  15. # which are used on pushing to REPO-store
  16. token: ${{ secrets.DINAR_TOKEN }}
  17. - name: Fetch REPO-store
  18. run: |
  19. git remote add store https://x-access-token:${{ secrets.DINAR_TOKEN }}@github.com/${GITHUB_REPOSITORY}-store.git
  20. git fetch store
  21. - name: Merge and Push
  22. run: |
  23. set -x
  24. git config --global user.email "itpp-bot@users.noreply.github.com"
  25. git config --global user.name "Mitchell Admin"
  26. BRANCH=${GITHUB_REF##*/}
  27. REF=$(git rev-parse HEAD)
  28. git checkout -b $BRANCH-store store/$BRANCH
  29. git merge origin/$BRANCH $REF
  30. git push store $BRANCH-store:$BRANCH