Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 2 additions & 13 deletions .github/workflows/update_deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Run dependency update script
id: update
run: python scripts/update_deps.py
run: python scripts/update_deps.py > "$RUNNER_TEMP/pr_body.txt"

- name: Check if updates were found
id: check
Expand All @@ -47,17 +47,6 @@ jobs:
VERSION=$(grep '^version = ' pyproject.toml | grep -oP '\d+\.\d+\.\d+')
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Build PR body with version changes
if: steps.check.outputs.changed == 'true'
id: pr_body
run: |
{
echo "## Version Changes"
echo ""
git diff src/komamripy/juliapkg.json | grep -E '^\+.*version|^-.*version' | sed 's/^+/→ /' | sed 's/^-/← /'
} > pr_body.txt
cat pr_body.txt

- name: Create pull request
if: steps.check.outputs.changed == 'true'
id: cpr
Expand All @@ -66,7 +55,7 @@ jobs:
token: ${{ secrets.AUTOMATION_TOKEN }}
commit-message: 'chore: update KomaMRI dependencies'
title: '[auto] Bump to version ${{ steps.version.outputs.version }}'
body-path: pr_body.txt
body-path: ${{ runner.temp }}/pr_body.txt
branch: update-koma-deps
delete-branch: true
labels: 'dependencies'
Expand Down
12 changes: 0 additions & 12 deletions pr_body.txt

This file was deleted.

11 changes: 11 additions & 0 deletions scripts/update_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ def compare_versions(current, resolved):
return changes, updated, new_python_version


def format_pr_body(changes):
"""Format dependency changes for the automated pull request."""
lines = ["## Version Changes", ""]
for change in changes:
package, versions = change.split(": ", 1)
lines.append(f"- **{package}**: {versions}")
return "\n".join(lines)


def main():
# Read current juliapkg.json
juliapkg_path = Path("src/komamripy/juliapkg.json")
Expand All @@ -121,6 +130,8 @@ def main():
json.dump(current, f, indent=2)
f.write("\n") # Add newline at end

print(format_pr_body(changes))

return 0


Expand Down