@@ -45,11 +45,20 @@ jobs:
4545 )
4646 runs-on : ubuntu-latest
4747 steps :
48+ - name : Generate GitHub App token
49+ id : app-token
50+ uses : actions/create-github-app-token@3ff1caaa28b64c9cc276ce0a02e2ff584f3900c5 # v2.0.2
51+ with :
52+ app-id : ${{ secrets.DOCS_BOT_APP_ID }}
53+ private-key : ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
54+ owner : github
55+ repositories : docs-internal,docs-content
56+
4857 - name : Resolve PR data
4958 id : resolve_pr
5059 uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
5160 with :
52- github-token : ${{ secrets.DOCS_BOT_PAT_BASE }}
61+ github-token : ${{ steps.app-token.outputs.token }}
5362 script : |
5463 let pr;
5564 if (context.eventName === 'workflow_dispatch') {
7786 id : check_team
7887 uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
7988 with :
80- github-token : ${{ secrets.DOCS_BOT_PAT_BASE }}
89+ github-token : ${{ steps.app-token.outputs.token }}
8190 script : |
8291 const author = '${{ steps.resolve_pr.outputs.pr_author }}';
8392
@@ -115,7 +124,7 @@ jobs:
115124 env :
116125 PR_BODY : ${{ steps.resolve_pr.outputs.pr_body }}
117126 with :
118- github-token : ${{ secrets.DOCS_BOT_PAT_BASE }}
127+ github-token : ${{ steps.app-token.outputs.token }}
119128 script : |
120129 const body = process.env.PR_BODY || '';
121130
@@ -150,7 +159,7 @@ jobs:
150159 id : check_parent
151160 uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
152161 with :
153- github-token : ${{ secrets.DOCS_BOT_PAT_BASE }}
162+ github-token : ${{ steps.app-token.outputs.token }}
154163 script : |
155164 const issueNumber = parseInt('${{ steps.extract_issue.outputs.issue_number }}', 10);
156165
@@ -231,7 +240,7 @@ jobs:
231240 PR_BODY : ${{ steps.resolve_pr.outputs.pr_body }}
232241 PR_URL : ${{ steps.resolve_pr.outputs.pr_url }}
233242 with :
234- github-token : ${{ secrets.DOCS_BOT_PAT_BASE }}
243+ github-token : ${{ steps.app-token.outputs.token }}
235244 script : |
236245 const prNumber = parseInt('${{ steps.resolve_pr.outputs.pr_number }}', 10);
237246 const prAuthor = '${{ steps.resolve_pr.outputs.pr_author }}';
@@ -272,7 +281,7 @@ jobs:
272281 id : check_existing
273282 uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
274283 with :
275- github-token : ${{ secrets.DOCS_BOT_PAT_BASE }}
284+ github-token : ${{ steps.app-token.outputs.token }}
276285 script : |
277286 const branchName = `changelog-agent-${{ steps.resolve_pr.outputs.pr_number }}`;
278287 const { data: pulls } = await github.rest.pulls.list({
@@ -295,7 +304,7 @@ jobs:
295304 id : read_examples
296305 uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
297306 with :
298- github-token : ${{ secrets.DOCS_BOT_PAT_BASE }}
307+ github-token : ${{ steps.app-token.outputs.token }}
299308 script : |
300309 // Fetch changelog-internal.md from docs-content
301310 const { data } = await github.rest.repos.getContent({
@@ -420,7 +429,10 @@ jobs:
420429 uses : actions/ai-inference@17ff458cb182449bbb2e43701fcd98f6af8f6570 # v2.1.0
421430 with :
422431 provider : copilot
423- model : gpt-4.1
432+ # No model is pinned: actions/ai-inference forwards --model to the
433+ # Copilot CLI only when it differs from its GitHub Models default, so
434+ # omitting it lets the CLI pick its own current default (latest Sonnet)
435+ # and avoids breaking when a pinned slug (e.g. gpt-4.1) is retired.
424436 prompt-file : prompt.txt
425437 system-prompt-file : system-prompt.txt
426438 max-completion-tokens : 1000
@@ -462,7 +474,7 @@ jobs:
462474 PARENT_AUTHOR : ${{ steps.check_parent.outputs.parent_author }}
463475 PARENT_ASSIGNEES : ${{ steps.check_parent.outputs.parent_assignees }}
464476 with :
465- github-token : ${{ secrets.DOCS_BOT_PAT_BASE }}
477+ github-token : ${{ steps.app-token.outputs.token }}
466478 script : |
467479 const branchName = `changelog-agent-${{ steps.resolve_pr.outputs.pr_number }}`;
468480 const filePath = 'docs-content-docs/docs-content-workflows/changelog-internal.md';
@@ -623,7 +635,7 @@ jobs:
623635 PARENT_AUTHOR : ${{ steps.check_parent.outputs.parent_author }}
624636 PARENT_ASSIGNEES : ${{ steps.check_parent.outputs.parent_assignees }}
625637 with :
626- github-token : ${{ secrets.DOCS_BOT_PAT_BASE }}
638+ github-token : ${{ steps.app-token.outputs.token }}
627639 script : |
628640 const author = process.env.PR_AUTHOR;
629641 const changelogPrUrl = process.env.CHANGELOG_PR_URL;
@@ -718,7 +730,7 @@ jobs:
718730 if : steps.create_pr.outputs.changelog_pr_url != '' && inputs.dry_run != true
719731 uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
720732 with :
721- github-token : ${{ secrets.DOCS_BOT_PAT_BASE }}
733+ github-token : ${{ steps.app-token.outputs.token }}
722734 script : |
723735 const changelogPrUrl = '${{ steps.create_pr.outputs.changelog_pr_url }}';
724736 await github.rest.issues.createComment({
0 commit comments