diff --git a/.github/workflows/add-docs-link-comment.yml b/.github/workflows/add-docs-link-comment.yml new file mode 100644 index 0000000..414b00d --- /dev/null +++ b/.github/workflows/add-docs-link-comment.yml @@ -0,0 +1,25 @@ +name: Comment link to ReadTheDocs build + +on: + pull_request: + types: + - opened + +jobs: + comment: + runs-on: ubuntu-latest + steps: + - name: Add PR comment with doc link + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const prNumber = context.payload.pull_request.number; + const commentBody = `Link to docs build: https://canonical-kernel-docs--${prNumber}.com.readthedocs.build/en/${prNumber}/`; + + github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: prNumber, + body: commentBody + });