Skip to content

Add bundle update schedule - #2602

Merged
soutaro merged 1 commit into
masterfrom
workflow-update
Jul 17, 2025
Merged

Add bundle update schedule#2602
soutaro merged 1 commit into
masterfrom
workflow-update

Conversation

@soutaro

@soutaro soutaro commented Jul 17, 2025

Copy link
Copy Markdown
Member

No description provided.

@soutaro
soutaro requested a review from Copilot July 17, 2025 00:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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'

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: 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.
@soutaro
soutaro merged commit 97c312e into master Jul 17, 2025
21 checks passed
@soutaro
soutaro deleted the workflow-update branch July 17, 2025 00:19

@ParadoxV5 ParadoxV5 left a comment

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 don’t trust AI as long as they parse in tokens rather than letters.

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

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

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`" \

Comment on lines +21 to +24
- 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"

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.

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'?

gh pr create \
--title "bundle update `/Gemfile`" \
--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.

if: env.has_update == '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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants