-
Notifications
You must be signed in to change notification settings - Fork 20
90 lines (75 loc) · 2.45 KB
/
pydocs-preview.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: PyDocs Preview
on:
pull_request_target:
branches:
- master
jobs:
build:
if: github.repository_owner == 'PaloAltoNetworks'
name: Generate docs
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pipx
python -m pip install editfrontmatter
pipx install 'pydoc-markdown>=4.0.0,<5.0.0'
- name: Generate markdown docs
run: |
pydoc-markdown -vv
- name: Upload markdown artifacts
uses: actions/upload-artifact@v2
with:
name: docs-dir
path: docs/
pull:
name: Open pull request
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout docs repository
uses: actions/checkout@v2
with:
repository: 'PaloAltoNetworks/cortex.pan.dev'
- name: Download markdown artifacts
uses: actions/download-artifact@v2
with:
name: docs-dir
path: docs/
- name: Commit changes
id: commit
run: |
git config --global user.email "sserrata@paloaltonetworks.com"
git config --global user.name "Steven Serrata"
git add .
(git diff --exit-code || git diff --exit-code --cached) || git commit -m "update pydocs"
git status
- name: Create Pull Request
id: pydocs
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.PYDOC_TOKEN }}
commit-message: Update pydocs
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
delete-branch: true
title: '🚫 [PyDocs Preview] Preview python library docs'
labels: |
don't merge
body: |
Update pydocs
- Docs generated with `pydoc-markdown`
> **For preview/review purposes only**, please close this PR and delete branch when done. A new PR
will be opened (that can be merged) when upstream changes are merged to main branch.