|
15 | 15 | secrets: |
16 | 16 | hf_token: |
17 | 17 | required: true |
18 | | - comment_bot_token: |
| 18 | + comment_bot_app_id: |
| 19 | + required: true |
| 20 | + comment_bot_secret_pem: |
19 | 21 | required: true |
20 | 22 |
|
21 | 23 | jobs: |
@@ -101,21 +103,29 @@ jobs: |
101 | 103 | issue-number: ${{ steps.github-context.outputs.pr_number }} |
102 | 104 | body-includes: docs for this PR |
103 | 105 |
|
| 106 | + - name: Create comment_bot token |
| 107 | + id: comment_bot_token |
| 108 | + uses: actions/create-github-app-token@v2 |
| 109 | + with: |
| 110 | + app-id: ${{ secrets.comment_bot_app_id }} |
| 111 | + private-key: ${{ secrets.comment_bot_secret_pem }} |
| 112 | + repositories: ${{ github.event.repository.name }} |
| 113 | + |
104 | 114 | - name: Add doc comment if not present |
105 | 115 | uses: thollander/actions-comment-pull-request@v2 |
106 | 116 | if: steps.find_comment.outputs.comment-id == '' |
107 | 117 |
|
108 | 118 | with: |
109 | 119 | message: 'The docs for this PR live [here](${{ steps.hfhub-context.outputs.hub_docs_url }}). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.' |
110 | 120 | pr_number: ${{ steps.github-context.outputs.pr_number }} |
111 | | - GITHUB_TOKEN: ${{ secrets.comment_bot_token }} |
| 121 | + GITHUB_TOKEN: ${{ steps.comment_bot_token.outputs.token }} |
112 | 122 |
|
113 | 123 | - name: Update doc comment if necessary |
114 | 124 | if: github.event.action == 'reopened' && steps.find_comment.outputs.comment-id != '' |
115 | 125 | uses: peter-evans/create-or-update-comment@v1 |
116 | 126 | with: |
117 | 127 | comment-id: ${{ steps.find_comment.outputs.comment-id }} |
118 | | - token: ${{ secrets.comment_bot_token }} |
| 128 | + token: ${{ steps.comment_bot_token.outputs.token }} |
119 | 129 | edit-mode: replace |
120 | 130 | body: | |
121 | 131 | The docs for this PR live [here](${{ steps.hfhub-context.outputs.hub_docs_url }}). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
0 commit comments