Skip to content

Commit

Permalink
Allow changes to yarn.lock files
Browse files Browse the repository at this point in the history
This will allow Javascript dependencies to be automatically merged.

Example of PR that would be affected by this change: alphagov/travel-advice-publisher#1890

I have not added `Gemfile` and `package.json` to the allowed files list because in some cases we may have
legitimate reasons to keep dependencies pinned to specific versions and we don't want Dependabot to change that.
  • Loading branch information
MuriloDalRi committed May 7, 2024
1 parent 167f427 commit 9386d30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pull_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ def validate_single_commit
end

def validate_files_changed
allowed_files = ["yarn.lock", "Gemfile.lock"]
commit = GitHubClient.instance.commit("alphagov/#{@api_response.base.repo.name}", @api_response.head.sha)
files_changed = commit.files.map(&:filename)
# TODO: support other package managers too (e.g. NPM)
files_changed == ["Gemfile.lock"]
(files_changed - allowed_files).empty? && (files_changed & allowed_files).any?
end

def validate_ci_workflow_exists
Expand Down

0 comments on commit 9386d30

Please sign in to comment.