Add bundle update schedule - #2602
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a GitHub Actions workflow to automatically update Ruby gem dependencies on a weekly schedule. The workflow creates a new branch, runs bundle update, and opens a pull request if there are changes to the Gemfile.lock.
- Implements scheduled automation for dependency updates using GitHub Actions
- Creates unique branch names with timestamps and UUID prefixes to avoid conflicts
- Includes conditional logic to only create PRs when actual dependency changes occur
Comments suppressed due to low confidence (1)
.github/workflows/bundle-update.yml:56
- [nitpick] The PR title contains backticks around '/Gemfile' which may not render as intended in the GitHub UI. Consider using a cleaner format like 'Bundle update for Gemfile dependencies' or 'Automated bundle update'.
--title "bundle update `/Gemfile`" \
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: '3.4' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Ah yes, we love AI-generated content. /sarcasm
|
|
||
| - name: Run bundle update | ||
| run: | | ||
| bundle lock --update |
There was a problem hiding this comment.
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.
| bundle lock --update | |
| bundle update |
ParadoxV5
left a comment
There was a problem hiding this comment.
I don’t trust AI as long as they parse in tokens rather than letters.
| on: | ||
| schedule: | ||
| - cron: '0 0 * * 2' |
There was a problem hiding this comment.
Dependabot supports weekly scheduling and even arbitrary cron too, if you’re looking to update the Lockfile less frequently.
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| gh pr create \ | ||
| --title "bundle update `/Gemfile`" \ |
There was a problem hiding this comment.
| --title "bundle update `/Gemfile`" \ | |
| --title "bundle update `/Gemfile.lock`" \ |
| - 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" |
There was a problem hiding this comment.
I’d suggest setting up Git after “Run bundle update”, but it would mean more if: env.has_updates.
| echo "has_update=true" >> $GITHUB_ENV | ||
|
|
||
| - name: Push branch | ||
| if: env.has_update == 'true' |
There was a problem hiding this comment.
Speaking of which… why == 'true'?
| gh pr create \ | ||
| --title "bundle update `/Gemfile`" \ | ||
| --body "Automated bundle update" \ | ||
| --head "$(git rev-parse --abbrev-ref HEAD)" \ |
There was a problem hiding this comment.
Using the branch name is more convenient.
| if: env.has_update == 'true' | ||
| run: git push origin HEAD | ||
|
|
||
| - name: Create Pull Request |
There was a problem hiding this comment.
Nit: Capitalization differs between the step titles
No description provided.