From 20b2b27422c33491f0e23ad9d6059cad8cb5839f Mon Sep 17 00:00:00 2001 From: "Benjamin T. Vincent" Date: Sat, 1 Mar 2025 10:00:37 +0000 Subject: [PATCH 1/3] add the new workflow --- .github/workflows/uml.yml | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/uml.yml diff --git a/.github/workflows/uml.yml b/.github/workflows/uml.yml new file mode 100644 index 00000000..1770288b --- /dev/null +++ b/.github/workflows/uml.yml @@ -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." \ + --label "no releasenotes" \ + --reviewer drbenvincent + env: + GH_TOKEN: ${{ github.token }} From 8bdc30b27f456db4d5fcad46e72d21a51fb59225 Mon Sep 17 00:00:00 2001 From: "Benjamin T. Vincent" Date: Sat, 1 Mar 2025 10:54:20 +0000 Subject: [PATCH 2/3] Update .github/workflows/uml.yml Co-authored-by: Will Dean <57733339+wd60622@users.noreply.github.com> --- .github/workflows/uml.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/uml.yml b/.github/workflows/uml.yml index 1770288b..5edfe1f1 100644 --- a/.github/workflows/uml.yml +++ b/.github/workflows/uml.yml @@ -6,7 +6,6 @@ on: jobs: build: - if: github.event.pull_request.merged == true runs-on: ubuntu-latest permissions: write-all steps: From ca6355eb2591e3dcfec21fd85b161228e877b28b Mon Sep 17 00:00:00 2001 From: "Benjamin T. Vincent" Date: Sat, 1 Mar 2025 10:56:12 +0000 Subject: [PATCH 3/3] pymc-marketing -> CausalPy --- .github/workflows/uml.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/uml.yml b/.github/workflows/uml.yml index 1770288b..da954ce4 100644 --- a/.github/workflows/uml.yml +++ b/.github/workflows/uml.yml @@ -47,8 +47,8 @@ jobs: --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." \ + 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: