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

Pin GitHub Actions

Pin GitHub Actions #5

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@e9aba2c848f5ebd159c070c61ea2c4e2b122355e # 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@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # 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@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2
with:
repository: 'PaloAltoNetworks/cortex.pan.dev'
- name: Download markdown artifacts
uses: actions/download-artifact@cbed621e49e4c01b044d60f6c80ea4ed6328b281 # 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@18f7dc018cc2cd597073088f7c7591b9d1c02672 # 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.