Skip to content

Commit 20b2b27

Browse files
committed
add the new workflow
1 parent 9b85b2a commit 20b2b27

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/uml.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Update the UML Diagrams
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 12 * * 1'
6+
7+
jobs:
8+
build:
9+
if: github.event.pull_request.merged == true
10+
runs-on: ubuntu-latest
11+
permissions: write-all
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
ref: main
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.10"
21+
22+
- name: Configure Git Identity
23+
run: |
24+
git config user.name 'github-actions[bot]'
25+
git config user.email 'github-actions[bot]@users.noreply.github.com'
26+
- name: Update the UML Diagrams
27+
run: |
28+
sudo apt-get update && sudo apt-get install -y graphviz
29+
make uml
30+
- name: Detect UML changes
31+
id: changes
32+
run: |
33+
git add docs/source/uml/*.png
34+
if git diff --staged --exit-code; then
35+
echo "No changes to commit"
36+
echo "changes_exist=false" >> $GITHUB_OUTPUT
37+
else
38+
echo "changes_exist=true" >> $GITHUB_OUTPUT
39+
fi
40+
- name: Create PR for changes
41+
if: steps.changes.outputs.changes_exist == 'true'
42+
run: |
43+
git checkout -b update-uml-diagrams
44+
git commit -m "Update UML Diagrams"
45+
git push -u origin update-uml-diagrams
46+
gh pr create \
47+
--base main \
48+
--title "Update UML Diagrams" \
49+
--body "This PR updates the UML diagrams
50+
This PR was created automatically by the [UML workflow](https://github.com/pymc-labs/pymc-marketing/blob/main/.github/workflows/uml.yml).
51+
See the logs [here](https://github.com/pymc-labs/pymc-marketing/actions/workflows/uml.yml) for more details." \
52+
--label "no releasenotes" \
53+
--reviewer drbenvincent
54+
env:
55+
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)