Skip to content
Merged
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
59 changes: 59 additions & 0 deletions .github/workflows/bundle-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Scheduled Bundle Update PR

on:
schedule:
- cron: '0 0 * * 2'
Comment on lines +3 to +5

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dependabot supports weekly scheduling and even arbitrary cron too, if you’re looking to update the Lockfile less frequently.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, and batch updates too

workflow_dispatch:

jobs:
bundle-update:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'

Copilot AI Jul 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruby version 3.4 may not be available yet as it's a future release. Consider using a stable version like '3.3' or reading the version from a .ruby-version file to stay in sync with the project's actual Ruby version.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, we love AI-generated content. /sarcasm


- name: Set up git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
Comment on lines +21 to +24

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d suggest setting up Git after “Run bundle update”, but it would mean more if: env.has_updates.


- name: Switch branch
run: |
git switch -c bundle-update-$(date +'%Y%m%d')-$(uuidgen | cut -c1-8)

- name: Install bundler
run: gem install bundler

- name: Run bundle update
run: |
bundle lock --update

Copilot AI Jul 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'bundle lock --update' only updates the lockfile without installing gems, but the workflow doesn't install dependencies first. Consider adding 'bundle install' before the update or use 'bundle update' which handles both installation and updating.

Suggested change
bundle lock --update
bundle update

Copilot uses AI. Check for mistakes.
git add Gemfile.lock

if git diff --cached --quiet; then
echo "No changes to commit, exiting."
exit 0
fi

git commit -m "bundle update"
echo "has_update=true" >> $GITHUB_ENV

- name: Push branch
if: env.has_update == 'true'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Speaking of which… why == 'true'?

run: git push origin HEAD

- name: Create Pull Request

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Capitalization differs between the step titles

if: env.has_update == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr create \
--title "bundle update `/Gemfile`" \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
--title "bundle update `/Gemfile`" \
--title "bundle update `/Gemfile.lock`" \

--body "Automated bundle update" \
--head "$(git rev-parse --abbrev-ref HEAD)" \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the branch name is more convenient.

--base "main"
Loading