@@ -2,7 +2,7 @@ name: on-push-do-docs
22
33on :
44 push :
5- branches : [main ]
5+ branches : [mtomka/code-snippets ]
66 paths : [ "samples/Snippets/**" ]
77 workflow_dispatch :
88
4343 exit 0
4444 }
4545
46- $BranchName = "docs/update-docs"
46+ $BranchName = "docs/update-docs-$(Get-Date -Format "yyyyMMddHHmm")
47+ echo "branchName=$BranchName" >> $env:GITHUB_OUTPUT
48+
4749 $GitEmail = "138034000+polly-updater-bot[bot]@users.noreply.github.com"
4850 $GitUser = "polly-updater-bot[bot]"
4951
@@ -63,17 +65,16 @@ jobs:
6365 git commit -m "Update the code-snippets in the documentation"
6466 git push -u origin $BranchName
6567 " updated-docs=true" >> $env:GITHUB_OUTPUT
66-
67-
68+
6869 - name : Generate GitHub application token
6970 if : steps.update-docs.outputs.updated-docs == 'true'
7071 id : generate-application-token
7172 uses : peter-murray/workflow-application-token-action@8e1ba3bf1619726336414f1014e37f17fbadf1db # v2.1.0
7273 with :
73- application-id : ${{ secrets.POLLY_UPDATER_BOT_APP_ID }}
74- application-private-key : ${{ secrets.POLLY_UPDATER_BOT_KEY }}
74+ application_id : ${{ secrets.POLLY_UPDATER_BOT_APP_ID }}
75+ application_private_key : ${{ secrets.POLLY_UPDATER_BOT_KEY }}
7576 permissions : " contents:write, pull_requests:write"
76-
77+
7778 - name : Create pull request
7879 if : steps.update-docs.outputs.updated-docs == 'true'
7980 uses : actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
@@ -82,11 +83,12 @@ jobs:
8283 script : |
8384 const { repo, owner } = context.repo;
8485 const workflowUrl = `${{ github.server_url }}/${owner}/${repo}/actions/runs/${process.env.GITHUB_RUN_ID}`;
86+ const branchName = "${{ steps.update-docs.outputs.branchName }}";
8587 const result = await github.rest.pulls.create({
8688 title: 'Update the code-snippets in the documentation',
8789 owner,
8890 repo,
89- head: 'docs/update-docs' ,
91+ head: branchName ,
9092 base: 'main',
9193 body: [
9294 'This PR updates the code-snippets in the documentation.',
0 commit comments