-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (58 loc) · 2.4 KB
/
Copy pathupdate-septic-docs-pr.yml
File metadata and controls
69 lines (58 loc) · 2.4 KB
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
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@v7
- name: Setup Python
uses: actions/setup-python@v6
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 packages/septic/public/
# --quiet does apparently not imply --exit-code as git doc claims
echo "changed=$(git diff HEAD --exit-code packages/septic/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: Update skill object references
if: ${{ steps.checkfiles.outputs.changed != 0 && env.REF == 'latest' }}
run: python scripts/generate_examples.py latest
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
if: ${{ steps.checkfiles.outputs.changed != 0 }}
with:
add-paths: |
packages/septic/public/*
packages/extension/package.json
packages/extension/skills/writing-septic-config/objects/*
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.