Skip to content

Commit

Permalink
Add link to RTD build for PRs (#1786)
Browse files Browse the repository at this point in the history
Create a message in PR with link to the PR's ReadTheDocs before it's merged.

Fixes #1610
  • Loading branch information
TerrenceMcGuinness-NOAA committed Aug 9, 2023
1 parent 1d38e97 commit a4b66c3
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
})

0 comments on commit a4b66c3

Please sign in to comment.