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
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: JavaScript
name: JavaScript - CI

on:
push:
branches:
- master
paths:
- .github/workflows/javascript.yml
- .github/workflows/javascript--ci.yml
- .node-version
- javascript/package.json
- javascript/pnpm-lock.yaml
- javascript/pnpm-workspace.yaml
- javascript/**/*.js
pull_request:
paths:
- .github/workflows/javascript.yml
- .github/workflows/javascript--ci.yml
- .node-version
- javascript/package.json
- javascript/pnpm-lock.yaml
Expand All @@ -40,7 +40,7 @@ jobs:
with:
filters: |
javascript:
- .github/workflows/javascript.yml
- .github/workflows/javascript--ci.yml
- .node-version
- javascript/package.json
- javascript/pnpm-lock.yaml
Expand Down
109 changes: 109 additions & 0 deletions .github/workflows/javascript--daily-dependencies-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# This workflow updates pnpm package dependencies every day in every
# application that contains JavaScript (including Ruby on Rails applications
# with a package.json) and opens a pull request when any dependency changes
# are detected.

name: JavaScript - Daily Dependencies Update

on:
schedule:
# 0:00 JST every day
- cron: "0 15 * * *"
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
update:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version-file: .node-version
- name: Install pnpm
run: corepack enable && corepack prepare pnpm@latest --activate
- name: Update pnpm Package Dependencies in javascript
working-directory: ./javascript
run: pnpm update
- name: Update pnpm Package Dependencies in typescript
working-directory: ./typescript
run: pnpm update
- name: Update pnpm Package Dependencies in reactjs
working-directory: ./reactjs
run: pnpm update
- name: Update pnpm Package Dependencies in ruby-on-rails/perfect-ruby-on-rails
working-directory: ./ruby-on-rails/perfect-ruby-on-rails
run: pnpm update
- name: Generate Pull Request Description
env:
BODY_PATH: ${{ runner.temp }}/pr_body.md
run: |
package_rows() {
git diff --unified=0 -- "$1/pnpm-lock.yaml" \
| grep -E "^[+-] '?[^ ]+@[0-9]" \
| grep -v '(' \
| sed -E "s/^(.) /\1 /; s/'//g; s/:$//" \
| awk '{ i = match($2, /@[^@]*$/); print $1, substr($2, 1, i - 1), substr($2, i + 1) }' \
| awk '{ if ($1 == "-") before[$2] = $3; else after[$2] = $3 }
END {
for (name in after) {
if (name in before) {
if (before[name] != after[name]) print "|" name " |" before[name] " |" after[name] " |Updated |"
delete before[name]
} else {
print "|" name " |- |" after[name] " |Added |"
}
}
for (name in before) print "|" name " |" before[name] " |- |Removed |"
}' \
| sort
}
{
cat <<'OVERVIEW'
## 1. Overview

This pull request was created automatically by the JavaScript - Daily Dependencies Update workflow.
It updates every pnpm package dependency to the latest version allowed by each package.json and regenerates each pnpm-lock.yaml:

~~~console
pnpm update
~~~

## 2. Key Changes & Differences
OVERVIEW
for app in javascript typescript reactjs ruby-on-rails/perfect-ruby-on-rails; do
echo
echo "### $app"
echo
echo "|Packages |Before |After |Changes & Differences |"
echo "|:-|:-|:-|:-|"
ROWS=$(package_rows "$app")
if [ -z "$ROWS" ]; then ROWS='| | | |No dependency changes detected |'; fi
echo "$ROWS"
done
cat <<SUMMARY

## 3. Summary

All pnpm package dependencies in javascript, typescript, reactjs, and ruby-on-rails/perfect-ruby-on-rails are now up to date.
Please make sure that all CI workflows pass before merging this pull request.

## 4. References

- [JavaScript - Daily Dependencies Update workflow run](https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID)
- [pnpm update documentation](https://pnpm.io/cli/update)
SUMMARY
} > "$BODY_PATH"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
with:
branch: daily/javascript-dependency-updates
delete-branch: true
commit-message: "[Daily][JavaScript] Update pnpm Package Dependencies"
title: "[Daily][JavaScript] Update pnpm Package Dependencies"
body-path: ${{ runner.temp }}/pr_body.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python
name: Python - CI

on:
push:
branches:
- master
paths:
- .github/actions/setup-python/action.yml
- .github/workflows/python.yml
- .github/workflows/python--ci.yml
- .python-version
- requirements.txt
- requirements.lock
Expand All @@ -18,7 +18,7 @@ on:
pull_request:
paths:
- .github/actions/setup-python/action.yml
- .github/workflows/python.yml
- .github/workflows/python--ci.yml
- .python-version
- requirements.txt
- requirements.lock
Expand All @@ -43,7 +43,7 @@ jobs:
filters: |
python:
- .github/actions/setup-python/action.yml
- .github/workflows/python.yml
- .github/workflows/python--ci.yml
- .python-version
- requirements.txt
- requirements.lock
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/python--daily-dependencies-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# This workflow updates pip library dependencies every day and opens a pull
# request when any dependency changes are detected.

name: Python - Daily Dependencies Update

on:
schedule:
# 0:00 JST every day
- cron: "0 15 * * *"
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
update:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: .python-version
- name: Update pip Library Dependencies
working-directory: ./python
run: |
pip install --upgrade pip
pip install -r requirements.txt --upgrade
pip freeze > requirements.lock
- name: Generate Pull Request Description
env:
BODY_PATH: ${{ runner.temp }}/pr_body.md
run: |
ROWS=$(git diff --unified=0 -- python/requirements.lock \
| grep -E '^[+-][A-Za-z0-9]' \
| sed -E 's/^(.)/\1 /; s/==/ /' \
| awk '{ if ($1 == "-") before[$2] = $3; else after[$2] = $3 }
END {
for (name in after) {
if (name in before) {
if (before[name] != after[name]) print "|" name " |" before[name] " |" after[name] " |Updated |"
delete before[name]
} else {
print "|" name " |- |" after[name] " |Added |"
}
}
for (name in before) print "|" name " |" before[name] " |- |Removed |"
}' \
| sort)
if [ -z "$ROWS" ]; then ROWS='| | | |No dependency changes detected |'; fi
cat > "$BODY_PATH" <<EOF
## 1. Overview

This pull request was created automatically by the Python - Daily Dependencies Update workflow.
It upgrades pip itself, upgrades every library listed in requirements.txt to the latest available versions, and regenerates requirements.lock:

~~~console
pip install --upgrade pip
pip install -r requirements.txt --upgrade
pip freeze > requirements.lock
~~~

## 2. Key Changes & Differences

|Libraries |Before |After |Changes & Differences |
|:-|:-|:-|:-|
$ROWS

## 3. Summary

All pip library dependencies in python/requirements.lock are now up to date.
Please make sure that all CI workflows pass before merging this pull request.

## 4. References

- [Python - Daily Dependencies Update workflow run](https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID)
- [pip install documentation](https://pip.pypa.io/en/stable/cli/pip_install/)
EOF
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
with:
branch: daily/python-dependency-updates
delete-branch: true
commit-message: "[Daily][Python] Update pip Library Dependencies"
title: "[Daily][Python] Update pip Library Dependencies"
body-path: ${{ runner.temp }}/pr_body.md
117 changes: 117 additions & 0 deletions .github/workflows/ruby-on-rails--daily-dependencies-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# This workflow updates gem dependencies and the RBS collection every day in
# every Ruby on Rails application and opens a pull request when any dependency
# changes are detected.

name: Ruby on Rails - Daily Dependencies Update

on:
schedule:
# 0:00 JST every day
- cron: "0 15 * * *"
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
update:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
- name: Update Gem Dependencies in ruby-on-rails/e-navigator
working-directory: ./ruby-on-rails/e-navigator
env:
BUNDLE_FROZEN: "false"
run: |
gem update --system
gem install bundler
bundle update --all
bundle exec rbs collection update
- name: Update Gem Dependencies in ruby-on-rails/perfect-ruby-on-rails
working-directory: ./ruby-on-rails/perfect-ruby-on-rails
env:
BUNDLE_FROZEN: "false"
run: |
bundle update --all
bundle exec rbs collection update
- name: Update Gem Dependencies in ruby-on-rails/restful-api
working-directory: ./ruby-on-rails/restful-api
env:
BUNDLE_FROZEN: "false"
run: |
bundle update --all
bundle exec rbs collection update
- name: Generate Pull Request Description
env:
BODY_PATH: ${{ runner.temp }}/pr_body.md
run: |
gem_rows() {
git diff --unified=0 -- "$1/Gemfile.lock" \
| grep -E '^[+-] {4}[^ ]+ \([0-9]' \
| sed -E 's/^(.) +/\1 /; s/[()]//g' \
| awk '{ if ($1 == "-") before[$2] = $3; else after[$2] = $3 }
END {
for (name in after) {
if (name in before) {
if (before[name] != after[name]) print "|" name " |" before[name] " |" after[name] " |Updated |"
delete before[name]
} else {
print "|" name " |- |" after[name] " |Added |"
}
}
for (name in before) print "|" name " |" before[name] " |- |Removed |"
}' \
| sort
}
{
cat <<'OVERVIEW'
## 1. Overview

This pull request was created automatically by the Ruby on Rails - Daily Dependencies Update workflow.
It upgrades RubyGems and Bundler, updates every gem to the latest version allowed by each Gemfile, and updates each RBS collection:

~~~console
gem update --system
gem install bundler
bundle update --all
bundle exec rbs collection update
~~~

## 2. Key Changes & Differences
OVERVIEW
for app in ruby-on-rails/e-navigator ruby-on-rails/perfect-ruby-on-rails ruby-on-rails/restful-api; do
echo
echo "### $app"
echo
echo "|Gems |Before |After |Changes & Differences |"
echo "|:-|:-|:-|:-|"
ROWS=$(gem_rows "$app")
if [ -z "$ROWS" ]; then ROWS='| | | |No dependency changes detected |'; fi
echo "$ROWS"
done
cat <<SUMMARY

## 3. Summary

All gem dependencies and RBS collections (rbs_collection.lock.yaml) in the Ruby on Rails applications are now up to date.
Please make sure that all CI workflows pass before merging this pull request.

## 4. References

- [Ruby on Rails - Daily Dependencies Update workflow run](https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID)
- [bundle update documentation](https://bundler.io/man/bundle-update.1.html)
- [RBS collection documentation](https://github.com/ruby/rbs/blob/master/docs/collection.md)
SUMMARY
} > "$BODY_PATH"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
with:
branch: daily/ruby-on-rails-dependency-updates
delete-branch: true
commit-message: "[Daily][Ruby on Rails] Update Gem dependencies"
title: "[Daily][Ruby on Rails] Update Gem dependencies"
body-path: ${{ runner.temp }}/pr_body.md
Loading