Skip to content

update-vscode-septic-docs #59

update-vscode-septic-docs

update-vscode-septic-docs #59

name: "📚 Update SEPTIC docs"
on:
workflow_dispatch:
repository_dispatch:
types: [update-vscode-septic-docs]
jobs:
update_doc_pr:
name: "📚 Update PR"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install -r scripts/requirements.txt
- name: Update documentation
env:
API_TOKEN: ${{ secrets.SEPTIC_REPO_READ }}
run: python scripts/main.py ${{ github.event.client_payload.ref}}
- name: Look for documentation changes
id: checkfiles
run: |
# Ensure any new files are added before checking for changes
git add public/
# --quiet does apparently not imply --exit-code as git doc claims
echo "changed=$(git diff HEAD --exit-code public ':!**/meta.yaml' >/dev/null; echo $?)" >> $GITHUB_OUTPUT
- name: Extract ref name
if: ${{ steps.checkfiles.outputs.changed != 0 }}
run: |
ref=$(echo ${{ github.event.client_payload.ref }} | cut -d'/' -f3)
if [ "$ref" = "main" ]; then
ref="latest"
fi
echo "REF=$ref" >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
if: ${{ steps.checkfiles.outputs.changed != 0 }}
with:
add-paths: |
public/*
package.json
labels: "documentation"
branch: "septic-documentation-${{ env.REF }}"
title: "docs: update SEPTIC documentation for ${{ env.REF }}"
commit-message: "Autogenerated from SEPTIC repository"
delete-branch: true
body: |
## SEPTIC code documentation update :memo:
This PR was automatically generated due to one or more commits in the SEPTIC main branch that update the documentation for calcs or objects.
Merge this PR to update main branch with current SEPTIC documentation.