Skip to content

Commit 39e3200

Browse files
authored
chore: update UML action (#2112)
* update pr action * remove duplicated logic * work through creds
1 parent d8a197b commit 39e3200

File tree

1 file changed

+15
-31
lines changed

1 file changed

+15
-31
lines changed

.github/workflows/uml.yml

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Update the UML Diagrams
33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: '0 12 * * 1'
6+
- cron: "0 12 * * 1"
77

88
jobs:
99
build:
@@ -14,48 +14,32 @@ jobs:
1414
uses: actions/checkout@v6
1515
with:
1616
ref: main
17+
persist-credentials: false
18+
fetch-depth: 0
1719

1820
- name: Set up Python
1921
uses: actions/setup-python@v6
2022
with:
2123
python-version: "3.13"
2224

23-
- name: Configure Git Identity
24-
run: |
25-
git config user.name 'github-actions[bot]'
26-
git config user.email 'github-actions[bot]@users.noreply.github.com'
27-
2825
- name: Update the UML Diagrams
2926
run: |
3027
sudo apt-get update && sudo apt-get install -y graphviz
3128
make uml
3229
33-
- name: Detect UML changes
34-
id: changes
35-
run: |
36-
git add docs/source/uml/*.png
37-
if git diff --staged --exit-code; then
38-
echo "No changes to commit"
39-
echo "changes_exist=false" >> $GITHUB_OUTPUT
40-
else
41-
echo "changes_exist=true" >> $GITHUB_OUTPUT
42-
fi
43-
4430
- name: Create PR for changes
45-
if: steps.changes.outputs.changes_exist == 'true'
46-
run: |
47-
git checkout -b update-uml-diagrams
48-
git commit -m "Update UML Diagrams"
49-
git push -u origin update-uml-diagrams
50-
gh pr create \
51-
--base main \
52-
--title "Update UML Diagrams" \
53-
--body "This PR updates the UML diagrams
31+
uses: peter-evans/create-pull-request@v6
32+
with:
33+
token: ${{ github.token }}
34+
commit-message: "chore: Update UML Diagrams"
35+
title: "Update UML Diagrams"
36+
body: |
37+
This PR updates the UML diagrams
5438
5539
This PR was created automatically by the [UML workflow](https://github.com/pymc-labs/pymc-marketing/blob/main/.github/workflows/uml.yml).
5640
57-
See the logs [here](https://github.com/pymc-labs/pymc-marketing/actions/workflows/uml.yml) for more details." \
58-
--label "no releasenotes" \
59-
--reviewer "williambdean,juanitorduz"
60-
env:
61-
GH_TOKEN: ${{ github.token }}
41+
See the logs [here](https://github.com/pymc-labs/pymc-marketing/actions/workflows/uml.yml) for more details.
42+
branch: automated/update-uml-diagrams
43+
delete-branch: true
44+
labels: "no releasenotes"
45+
reviewers: williambdean,juanitorduz

0 commit comments

Comments
 (0)