Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/uml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Update the UML Diagrams
on:
workflow_dispatch:
schedule:
- cron: '0 12 * * 1'

jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Configure Git Identity
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Update the UML Diagrams
run: |
sudo apt-get update && sudo apt-get install -y graphviz
make uml
- name: Detect UML changes
id: changes
run: |
git add docs/source/uml/*.png
if git diff --staged --exit-code; then
echo "No changes to commit"
echo "changes_exist=false" >> $GITHUB_OUTPUT
else
echo "changes_exist=true" >> $GITHUB_OUTPUT
fi
- name: Create PR for changes
if: steps.changes.outputs.changes_exist == 'true'
run: |
git checkout -b update-uml-diagrams
git commit -m "Update UML Diagrams"
git push -u origin update-uml-diagrams
gh pr create \
--base main \
--title "Update UML Diagrams" \
--body "This PR updates the UML diagrams
This PR was created automatically by the [UML workflow](https://github.com/pymc-labs/CausalPy/blob/main/.github/workflows/uml.yml).
See the logs [here](https://github.com/pymc-labs/CausalPy/actions/workflows/uml.yml) for more details." \
--label "no releasenotes" \
--reviewer drbenvincent
env:
GH_TOKEN: ${{ github.token }}