From 1dc5dbbc29122aa7ca34acb37affa29eda79bc7d Mon Sep 17 00:00:00 2001 From: hayat01sh1da Date: Tue, 7 Jul 2026 17:56:46 +0900 Subject: [PATCH 1/3] Commit daily library dependencies update cron job workflows --- .../javascript--daily-dependencies-update.yml | 87 ++++++++++++++++++ .../python--daily-dependencies-update.yml | 88 +++++++++++++++++++ .../ruby--daily-dependencies-update.yml | 88 +++++++++++++++++++ 3 files changed, 263 insertions(+) create mode 100644 .github/workflows/javascript--daily-dependencies-update.yml create mode 100644 .github/workflows/python--daily-dependencies-update.yml create mode 100644 .github/workflows/ruby--daily-dependencies-update.yml diff --git a/.github/workflows/javascript--daily-dependencies-update.yml b/.github/workflows/javascript--daily-dependencies-update.yml new file mode 100644 index 0000000..4afb96c --- /dev/null +++ b/.github/workflows/javascript--daily-dependencies-update.yml @@ -0,0 +1,87 @@ +# This workflow updates pnpm package dependencies every day 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 + working-directory: ./javascript + run: pnpm update + - name: Generate Pull Request Description + env: + BODY_PATH: ${{ runner.temp }}/pr_body.md + run: | + ROWS=$(git diff --unified=0 -- javascript/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) + if [ -z "$ROWS" ]; then ROWS='| | | |No dependency changes detected |'; fi + cat > "$BODY_PATH" < 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" < 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 diff --git a/.github/workflows/ruby--daily-dependencies-update.yml b/.github/workflows/ruby--daily-dependencies-update.yml new file mode 100644 index 0000000..6b75905 --- /dev/null +++ b/.github/workflows/ruby--daily-dependencies-update.yml @@ -0,0 +1,88 @@ +# This workflow updates gem dependencies every day and opens a pull request +# when any dependency changes are detected. + +name: Ruby - 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 + working-directory: ./ruby + env: + BUNDLE_FROZEN: "false" + run: | + gem update --system + gem install bundler + bundle update --all + - name: Generate Pull Request Description + env: + BODY_PATH: ${{ runner.temp }}/pr_body.md + run: | + ROWS=$(git diff --unified=0 -- ruby/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) + if [ -z "$ROWS" ]; then ROWS='| | | |No dependency changes detected |'; fi + cat > "$BODY_PATH" < Date: Tue, 7 Jul 2026 18:16:01 +0900 Subject: [PATCH 2/3] Rename existing CI job workflows --- .../workflows/{javascript.yml => javascript--ci.yml} | 8 ++++---- .github/workflows/{python.yml => python--ci.yml} | 8 ++++---- .github/workflows/{ruby.yml => ruby--ci.yml} | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) rename .github/workflows/{javascript.yml => javascript--ci.yml} (90%) rename .github/workflows/{python.yml => python--ci.yml} (95%) rename .github/workflows/{ruby.yml => ruby--ci.yml} (93%) diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript--ci.yml similarity index 90% rename from .github/workflows/javascript.yml rename to .github/workflows/javascript--ci.yml index 49826fc..cbbca67 100644 --- a/.github/workflows/javascript.yml +++ b/.github/workflows/javascript--ci.yml @@ -1,14 +1,14 @@ # 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 @@ -16,7 +16,7 @@ on: - javascript/**/*.js pull_request: paths: - - .github/workflows/javascript.yml + - .github/workflows/javascript--ci.yml - .node-version - javascript/package.json - javascript/pnpm-lock.yaml @@ -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 diff --git a/.github/workflows/python.yml b/.github/workflows/python--ci.yml similarity index 95% rename from .github/workflows/python.yml rename to .github/workflows/python--ci.yml index b0a5b17..7321985 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python--ci.yml @@ -1,7 +1,7 @@ # 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: @@ -9,7 +9,7 @@ on: - master paths: - .github/actions/setup-python/action.yml - - .github/workflows/python.yml + - .github/workflows/python--ci.yml - .python-version - requirements.txt - requirements.lock @@ -19,7 +19,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 @@ -45,7 +45,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 diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby--ci.yml similarity index 93% rename from .github/workflows/ruby.yml rename to .github/workflows/ruby--ci.yml index 0a96707..9c053f2 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby--ci.yml @@ -5,7 +5,7 @@ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby -name: Ruby +name: Ruby - CI on: push: @@ -13,7 +13,7 @@ on: - master paths: - .github/actions/setup-ruby/action.yml - - .github/workflows/ruby.yml + - .github/workflows/ruby--ci.yml - .ruby-version - ruby/**/*.rb - ruby/**/*.rbs @@ -25,7 +25,7 @@ on: pull_request: paths: - .github/actions/setup-ruby/action.yml - - .github/workflows/ruby.yml + - .github/workflows/ruby--ci.yml - .ruby-version - ruby/**/*.rb - ruby/**/*.rbs @@ -55,14 +55,14 @@ jobs: filters: | ruby: - .github/actions/setup-ruby/action.yml - - .github/workflows/ruby.yml + - .github/workflows/ruby--ci.yml - .ruby-version - ruby/**/*.rb - ruby/Gemfile - ruby/Gemfile.lock rubocop: - .github/actions/setup-ruby/action.yml - - .github/workflows/ruby.yml + - .github/workflows/ruby--ci.yml - .ruby-version - ruby/**/*.rb - ruby/Gemfile @@ -71,7 +71,7 @@ jobs: - ruby/.rubocop_todo.yml steep: - .github/actions/setup-ruby/action.yml - - .github/workflows/ruby.yml + - .github/workflows/ruby--ci.yml - .ruby-version - ruby/**/*.rb - ruby/**/*.rbs From de04228325c53e2645c34b0d0117e322a0703c13 Mon Sep 17 00:00:00 2001 From: hayat01sh1da Date: Tue, 7 Jul 2026 18:32:05 +0900 Subject: [PATCH 3/3] Update paths to Action Status on README.md --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d62656f..268e8ae 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ -[![Actions Status: JavaScript](https://github.com/hayat01sh1da/coding-tests/workflows/JavaScript/badge.svg)](https://github.com/hayat01sh1da/coding-tests/actions?query=workflow%3A%22JavaScript%22) -[![Actions Status: Python](https://github.com/hayat01sh1da/coding-tests/workflows/Python/badge.svg)](https://github.com/hayat01sh1da/coding-tests/actions?query=workflow%3A%22Python%22) -[![Actions Status: Ruby](https://github.com/hayat01sh1da/coding-tests/workflows/Ruby/badge.svg)](https://github.com/hayat01sh1da/coding-tests/actions?query=workflow%3A%22Ruby%22) +[![Actions Status: JavaScript - CI](https://github.com/hayat01sh1da/coding-tests/workflows/JavaScript%20-%20CI/badge.svg)](https://github.com/hayat01sh1da/coding-tests/actions?query=workflow%3A%22JavaScript%20-%20CI%22) +[![Actions Status: JavaScript - Daily Dependencies Update](https://github.com/hayat01sh1da/coding-tests/workflows/JavaScript%20-%20Daily%20Dependencies%20Update/badge.svg)](https://github.com/hayat01sh1da/coding-tests/actions?query=workflow%3A%22JavaScript%20-%20Daily%20Dependencies%20Update%22) +[![Actions Status: Python - CI](https://github.com/hayat01sh1da/coding-tests/workflows/Python%20-%20CI/badge.svg)](https://github.com/hayat01sh1da/coding-tests/actions?query=workflow%3A%22Python%20-%20CI%22) +[![Actions Status: Python - Daily Dependencies Update](https://github.com/hayat01sh1da/coding-tests/workflows/Python%20-%20Daily%20Dependencies%20Update/badge.svg)](https://github.com/hayat01sh1da/coding-tests/actions?query=workflow%3A%22Python%20-%20Daily%20Dependencies%20Update%22) +[![Actions Status: Ruby - CI](https://github.com/hayat01sh1da/coding-tests/workflows/Ruby%20-%20CI/badge.svg)](https://github.com/hayat01sh1da/coding-tests/actions?query=workflow%3A%22Ruby%20-%20CI%22) +[![Actions Status: Ruby - Daily Dependencies Update](https://github.com/hayat01sh1da/coding-tests/workflows/Ruby%20-%20Daily%20Dependencies%20Update/badge.svg)](https://github.com/hayat01sh1da/coding-tests/actions?query=workflow%3A%22Ruby%20-%20Daily%20Dependencies%20Update%22) [![Actions Status: CodeQL](https://github.com/hayat01sh1da/coding-tests/workflows/CodeQL/badge.svg)](https://github.com/hayat01sh1da/coding-tests/actions?query=workflow%3A%22CodeQL%22) ## 1. Common Environment