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.

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