-
Notifications
You must be signed in to change notification settings - Fork 66
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
automate UML diagrams #395
Open
wd60622
wants to merge
17
commits into
pymc-labs:main
Choose a base branch
from
wd60622:automate-uml
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
fea9b63
automate UML diagrams
wd60622 1f24d79
remove paths to run once
wd60622 acdc701
update env
wd60622 59cb1d3
use copilot rec...
wd60622 b45b80e
reference HEAD
wd60622 d3eba52
add token for auth
wd60622 9ba3e8a
use another copilot rec...
wd60622 bc7a35f
switch back to other token
wd60622 9584b76
back to action that fails the push access
wd60622 bc2b31e
add permissions to the bot
wd60622 7c0913b
checkout the branch directly
wd60622 1a4cfb9
up the version
wd60622 5395342
change location of permissions
wd60622 acd4544
point to the repo
wd60622 3fa282e
push to upstream instead
wd60622 06c9779
some logging
wd60622 59a4624
only trigger on merge to main
wd60622 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Update the UML Diagrams | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
branches: [main] | ||
paths: | ||
- "causalpy/**" | ||
|
||
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: ${{ github.head_ref || 'main' }} | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Configure Git Identity | ||
run: | | ||
git config user.name "$(git log -n 1 --pretty=format:%an)" | ||
git config user.email "$(git log -n 1 --pretty=format:%ae)" | ||
|
||
- name: Update the UML Diagrams | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y graphviz | ||
pip install --upgrade pip && pip install ".[docs]" | ||
make uml | ||
|
||
- name: Push up the changes | ||
run: | | ||
git add docs/source/_static/*.png | ||
if git diff --staged --exit-code; then | ||
echo "No changes to commit" | ||
else | ||
echo "Committing the changes" | ||
echo ${GITHUB_HEAD_REF} | ||
git commit -m "Update UML Diagrams" | ||
git push upstream HEAD:${GITHUB_HEAD_REF:-main} | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am very much a beginner when it comes to GitHub actions, but I've not seen anything about coffin of git identity in the other workflows. Could this be related to the permissions issue?
Or is it required for the later pushed changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required for pushing later.
Could be cause of permission. Not sure at the moment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think it might be if repo doesn't allow for bots to push code. I am seeing that the pre-commit bot didn't push either though the command was recognized