3737 repository : immutable/docs
3838 token : ${{ secrets.UNITY_SDK_DOCS_WORKFLOW }}
3939 path : imx-docs
40- ref : ' main '
40+ ref : ' DVR-295-docs-restructure '
4141
4242 - name : Setup environment variables
4343 run : echo "CLONE_DIR=./imx-docs" >> $GITHUB_ENV
@@ -65,20 +65,32 @@ jobs:
6565 .github/scripts/process-passport-tutorials.sh
6666 shell : bash
6767
68- - name : Commit and Push Changes to Docs Repo
68+ - name : Create Pull Request in Docs Repo
69+ id : create_pr
6970 run : |
7071 cd "$CLONE_DIR"
71- if git status --porcelain | grep -q .; then
72- git add .
73-
74- # Commit with reference to source commit
75- COMMIT_MSG="docs: Update Passport tutorials from Unity SDK (Ref: ${GITHUB_SHA::8})"
76- git commit -m "$COMMIT_MSG"
77-
78- # Push to the target branch
79- git push -u origin main
80- echo "Successfully pushed Passport tutorial changes to docs repo"
81- else
72+ if ! git status --porcelain | grep -q .; then
8273 echo "No changes to commit"
74+ echo "pr_url=" >> $GITHUB_OUTPUT
75+ exit 0
8376 fi
77+
78+ BRANCH_NAME="chore/sdk-docs-update-${{ github.run_id }}"
79+ git checkout -b $BRANCH_NAME
80+
81+ git add .
82+ git commit -m "Update example app tutorials from SDK repo"
83+ git push -u origin $BRANCH_NAME
84+ echo "Successfully pushed changes to docs repo on branch $BRANCH_NAME"
85+
86+ PR_URL=$(gh pr create \
87+ --title "Update example app tutorials from SDK repo" \
88+ --body "Automated PR from unity-immutable-sdk to update tutorials. Review and merge if all looks good." \
89+ --base DVR-295-docs-restructure \
90+ --repo immutable/docs)
91+
92+ echo "Successfully created PR in docs repo: $PR_URL"
93+ echo "pr_url=${PR_URL}" >> $GITHUB_OUTPUT
94+ env :
95+ GITHUB_TOKEN : ${{ secrets.UNITY_SDK_DOCS_WORKFLOW }}
8496 shell : bash
0 commit comments