name: Sync Repo on: workflow_dispatch: push: branches: - '*' - '*/*' - '**' jobs: git-sync: runs-on: ubuntu-latest steps: - name: git-sync uses: wei/git-sync@v3 with: source_repo: "standardnotes/app" source_branch: "refs/remotes/source/*" destination_repo: "standardnotes/internal-app" destination_branch: "refs/heads/*" ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} - name: Sleep to allow git-sync to fully complete run: sleep 10 shell: bash - uses: actions/checkout@v3 with: token: ${{ secrets.CI_PAT_TOKEN }} repository: standardnotes/internal-app ref: ${{ github.ref }} - name: Extract branch name shell: bash run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" id: extract_branch - name: Find open PR uses: juliangruber/find-pull-request-action@v1 id: find-pull-request with: branch: ${{ steps.extract_branch.outputs.branch }} - run: echo "Pull Request ${number} (${sha})" env: number: ${{ steps.find-pull-request.outputs.number }} sha: ${{ steps.find-pull-request.outputs.head-sha }} - uses: peter-evans/create-pull-request@v4 if: startsWith(github.event.head_commit.message, 'chore(deps)') == false && startsWith(github.event.head_commit.message, 'chore(deps-dev)') == false with: token: ${{ secrets.CI_PAT_TOKEN }} branch: ${{ github.ref }} base: main title: ${{ steps.extract_branch.outputs.branch }} body: "Public PR: https://github.com/standardnotes/app/pull/${{ steps.find-pull-request.outputs.number }}" assignees: ${{ github.actor }} reviewers: ${{ github.actor }}