Skip to content
This repository was archived by the owner on Mar 30, 2026. It is now read-only.

Commit 4082bd4

Browse files
authored
Create pydocs-publish.yml
1 parent 4ba0e03 commit 4082bd4

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: PyDocs Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
if: github.repository_owner == 'PaloAltoNetworks'
11+
name: Generate docs
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v2
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: '3.9'
24+
architecture: 'x64'
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install pipx
30+
python -m pip install editfrontmatter
31+
pipx install 'pydoc-markdown>=4.0.0,<5.0.0'
32+
- name: Generate markdown docs
33+
run: |
34+
pydoc-markdown -vv
35+
- name: Upload markdown artifacts
36+
uses: actions/upload-artifact@v2
37+
with:
38+
name: docs-dir
39+
path: docs/
40+
41+
pull:
42+
name: Open pull request
43+
needs: build
44+
runs-on: ubuntu-latest
45+
46+
steps:
47+
- name: Checkout docs repository
48+
uses: actions/checkout@v2
49+
with:
50+
repository: 'PaloAltoNetworks/cortex.pan.dev'
51+
52+
- name: Download markdown artifacts
53+
uses: actions/download-artifact@v2
54+
with:
55+
name: docs-dir
56+
path: docs/
57+
58+
- name: Commit changes
59+
id: commit
60+
run: |
61+
git config --global user.email "sserrata@paloaltonetworks.com"
62+
git config --global user.name "Steven Serrata"
63+
git add .
64+
(git diff --exit-code || git diff --exit-code --cached) || git commit -m "update pydocs"
65+
git status
66+
- name: Create Pull Request
67+
id: pydocs
68+
uses: peter-evans/create-pull-request@v3
69+
with:
70+
token: ${{ secrets.PYDOC_TOKEN }}
71+
commit-message: Update pydocs
72+
committer: GitHub <noreply@github.com>
73+
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
74+
delete-branch: true
75+
title: '✅ [PyDocs Publish] Publish python library docs'
76+
body: |
77+
Update pydocs
78+
- Docs generated with `pydoc-markdown`
79+
80+
> This PR includes changes ready to be merged to production. Please review and merge when ready.

0 commit comments

Comments
 (0)