Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/upload_pr_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ on:
secrets:
hf_token:
required: true
comment_bot_token:
comment_bot_app_id:
required: true
comment_bot_secret_pem:
required: true

jobs:
Expand Down Expand Up @@ -101,21 +103,29 @@ jobs:
issue-number: ${{ steps.github-context.outputs.pr_number }}
body-includes: docs for this PR

- name: Create comment_bot token
id: comment_bot_token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.comment_bot_app_id }}
private-key: ${{ secrets.comment_bot_secret_pem }}
repositories: ${{ github.event.repository.name }}

- name: Add doc comment if not present
uses: thollander/actions-comment-pull-request@v2
if: steps.find_comment.outputs.comment-id == ''

with:
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.'
pr_number: ${{ steps.github-context.outputs.pr_number }}
GITHUB_TOKEN: ${{ secrets.comment_bot_token }}
GITHUB_TOKEN: ${{ steps.comment_bot_token.outputs.token }}

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