Skip to content

Commit be9dcec

Browse files
PaulinePauline
authored andcommitted
Change generation auth token for COMMENT_BOT_TOKEN
1 parent bf5f4c2 commit be9dcec

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

‎.github/workflows/upload_pr_documentation.yml‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ on:
1515
secrets:
1616
hf_token:
1717
required: true
18-
comment_bot_token:
18+
comment_bot_app_id:
19+
required: true
20+
comment_bot_secret_pem:
1921
required: true
2022

2123
jobs:
@@ -101,21 +103,29 @@ jobs:
101103
issue-number: ${{ steps.github-context.outputs.pr_number }}
102104
body-includes: docs for this PR
103105

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+
104114
- name: Add doc comment if not present
105115
uses: thollander/actions-comment-pull-request@v2
106116
if: steps.find_comment.outputs.comment-id == ''
107117

108118
with:
109119
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.'
110120
pr_number: ${{ steps.github-context.outputs.pr_number }}
111-
GITHUB_TOKEN: ${{ secrets.comment_bot_token }}
121+
GITHUB_TOKEN: ${{ steps.comment_bot_token.outputs.token }}
112122

113123
- name: Update doc comment if necessary
114124
if: github.event.action == 'reopened' && steps.find_comment.outputs.comment-id != ''
115125
uses: peter-evans/create-or-update-comment@v1
116126
with:
117127
comment-id: ${{ steps.find_comment.outputs.comment-id }}
118-
token: ${{ secrets.comment_bot_token }}
128+
token: ${{ steps.comment_bot_token.outputs.token }}
119129
edit-mode: replace
120130
body: |
121131
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

Comments
 (0)