Skip to content

New GitHub workflow to generate PR's which update the UML diagrams #442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 1, 2025
Merged
Changes from 1 commit
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
55 changes: 55 additions & 0 deletions .github/workflows/uml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Update the UML Diagrams
on:
workflow_dispatch:
schedule:
- cron: '0 12 * * 1'

jobs:
build:
if: github.event.pull_request.merged == true
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/pymc-marketing/blob/main/.github/workflows/uml.yml).
See the logs [here](https://github.com/pymc-labs/pymc-marketing/actions/workflows/uml.yml) for more details." \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just change these links

--label "no releasenotes" \
--reviewer drbenvincent
env:
GH_TOKEN: ${{ github.token }}
Loading