diff --git a/.github/workflows/autoupdate-pr.yml b/.github/workflows/autoupdate-pr.yml index 569614720..a73b47e9a 100644 --- a/.github/workflows/autoupdate-pr.yml +++ b/.github/workflows/autoupdate-pr.yml @@ -24,10 +24,13 @@ jobs: - name: Auto update pull requests run: | - PR_LIST=$(curl -s -H "Authorization: Bearer ${{ secrets.DISPATCH_ACCESS_TOKEN }}" "https://api.github.com/repos/$GITHUB_REPOSITORY/pulls?state=open" | jq -r '.[] | .head.ref') + PR_LIST=$(curl -s -H "Authorization: Bearer ${{ secrets.DISPATCH_ACCESS_TOKEN }}" \ + "https://api.github.com/repos/$GITHUB_REPOSITORY/pulls?state=open&base=${{ github.ref_name }}" \ + | jq -r '.[] | select(.user.login=="box-sdk-build") | .head.ref') + for pr_branch in $PR_LIST; do git checkout "$pr_branch" - if git merge origin/combined-sdk; then + if git merge origin/${{ github.ref_name }}; then git push else # Conflict occurred, resolve by keeping our changes @@ -36,4 +39,4 @@ jobs: git commit -m "Auto resolve conflict by keeping our changes" git push fi - done \ No newline at end of file + done