Skip to content

Fixing url (tailing slash needed) and making PR number clickable #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/docbuild-and-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,10 @@ jobs:
name: website
path: web/build
retention-days: 14

- name: Trigger web/doc preview
run: curl -X POST https://pandas.pydata.org/preview/submit/$RUN_ID/$PR_ID/
env:
RUN_ID: ${{ github.run_id }}
PR_ID: ${{ github.event.pull_request.number }}
if: github.event_name == 'pull_request'
22 changes: 22 additions & 0 deletions .github/workflows/preview-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Preview docs
on:
issue_comment:
types: created

permissions:
contents: read

jobs:
preview_docs:
permissions:
issues: write
pull-requests: write
runs-on: ubuntu-22.04
steps:
- if: github.event.comment.body == '/preview'
run: |
if curl --output /dev/null --silent --head --fail "https://pandas.pydata.org/preview/${{ github.event.issue.number }}/"; then
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"body": "Website preview of this PR available at: https://pandas.pydata.org/preview/${{ github.event.issue.number }}/"}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments
else
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"body": "No preview found for PR #${{ github.event.issue.number }}. Did the docs build complete?"}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments
fi