Skip to content

docs: new GHA to add docs build link #2

docs: new GHA to add docs build link

docs: new GHA to add docs build link #2

name: Add PR comment
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
});