diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index ae083a3c0bf..6548d28a754 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -9,11 +9,16 @@ on: - release/* paths: - docs/** - pull_request: - types: [opened, reopened, synchronize] + pull_request_target: + types: [issues, opened, reopened, synchronize] jobs: + documentation: + + permissions: + pull-requests: 'write' + runs-on: ubuntu-latest name: Build and deploy documentation @@ -49,3 +54,17 @@ jobs: path: artifact/doc_warnings.log if-no-files-found: ignore + - name: Comment ReadDocs + uses: actions/github-script@v6 + with: + script: | + const message = ` + Link to ReadTheDocs sample build for this PR can be foune at: + https://global-workflow--${{ github.event.pull_request.number }}.org.readthedocs.build/en/${{ github.event.pull_request.number }} + ` + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: message + })