File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -93,21 +93,25 @@ jobs:
9393 git config --global user.email "[email protected] " 9494 git config --global user.name "GitHub Action"
9595 git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
96- git remote update origin
96+ git fetch origin
97+
9798 if gh pr list --head "update-bindings-${{ matrix.ros_distribution }}" --state open --json number --jq length | grep -q '^0$'; then
9899 echo "No existing PR found, will create new one"
99100 CREATE_PR=1
100101 else
101102 echo "PR already exists, will update it"
102103 CREATE_PR=0
103104 fi
105+
104106 git add rclrs/src/rcl_bindings_generated_${{ matrix.ros_distribution }}.rs
105107 git commit -m "Regenerate bindings for ${{ matrix.ros_distribution }}"
106- git fetch origin update-bindings-${{ matrix.ros_distribution }}
107- git rebase origin/update-bindings-${{ matrix.ros_distribution }}
108- git push -u origin update-bindings-${{ matrix.ros_distribution }}
108+
109+ git push -f origin HEAD:refs/heads /update-bindings-${{ matrix.ros_distribution }}
110+
109111 if [ $CREATE_PR -eq 1 ]; then
110112 gh pr create --base main --head update-bindings-${{ matrix.ros_distribution }} --title "Regenerate bindings for ${{ matrix.ros_distribution }}" --body "This PR regenerates the bindings for ${{ matrix.ros_distribution }}."
113+ else
114+ echo "PR already exists and has been updated with new commit"
111115 fi
112116 env :
113117 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments