File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -257,7 +257,22 @@ jobs:
257
257
git config --global user.email "${{ secrets.SA_GH_USER_EMAIL }}"
258
258
git commit -S -m "CI: UCC build for ${{ github.event_name }} event"
259
259
git push --force origin $GIT_BRANCH
260
-
260
+ - name : Create a PR if it does not exist yet
261
+ if : success() && github.event.inputs.run_pipelines == 'true'
262
+ working-directory : TA
263
+ env :
264
+ GH_TOKEN : ${{ secrets.GH_TOKEN_ADMIN }}
265
+ run : |
266
+ # Check if a PR already exists
267
+ if gh pr view -R ${{ matrix.target_repo }} $GIT_BRANCH; then
268
+ echo "PR already exists, not creating a new one"
269
+ exit 0
270
+ fi
271
+
272
+ echo "Creating a new draft PR from branch $GIT_BRANCH to ${{ github.event.inputs.target_branch }}"
273
+ gh pr create -R ${{ matrix.target_repo }} --title "CI: UCC build for ${{ github.event_name }} event" \
274
+ --body "This PR was created automatically to trigger the build-test-release pipeline." \
275
+ --base ${{ github.event.inputs.target_branch }} --head $GIT_BRANCH --draft
261
276
- name : Obtain the workflow run ID
262
277
if : success() && github.event.inputs.run_pipelines == 'true'
263
278
id : get-workflow-run-id
You can’t perform that action at this time.
0 commit comments