diff --git a/.github/workflows/upload_pr_documentation.yml b/.github/workflows/upload_pr_documentation.yml index bed40379..d9a37aaa 100644 --- a/.github/workflows/upload_pr_documentation.yml +++ b/.github/workflows/upload_pr_documentation.yml @@ -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: @@ -101,6 +103,14 @@ 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 == '' @@ -108,14 +118,14 @@ jobs: 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.