Skip to content

Commit d09c29d

Browse files
committed
Use type: Array for exclude parameter instead of deprecated is_string
1 parent 4208ed7 commit d09c29d

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

lib/fastlane/plugin/wpmreleasetoolkit/actions/common/find_previous_tag.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Actions
88
class FindPreviousTagAction < Action
99
def self.run(params)
1010
tag_pattern = params[:pattern]
11-
exclude_patterns = Array(params[:exclude])
11+
exclude_patterns = params[:exclude] || []
1212

1313
# Make sure we have all the latest tags fetched locally
1414
Actions.sh('git', 'fetch', '--tags', '--force') { nil }
@@ -41,7 +41,7 @@ def self.details
4141
reachable from the current commit and that matches a specific naming pattern
4242
4343
e.g. `find_previous_tag(pattern: '12.3.*.*')`, `find_previous_tag(pattern: '12.3-rc-*')`,
44-
`find_previous_tag(pattern: 'v*', exclude: '*beta*')`,
44+
`find_previous_tag(pattern: 'v*', exclude: ['*beta*'])`,
4545
`find_previous_tag(pattern: 'v*', exclude: ['*alpha*', '*beta*'])`
4646
DETAILS
4747
end
@@ -54,11 +54,10 @@ def self.available_options
5454
default_value: nil,
5555
type: String),
5656
FastlaneCore::ConfigItem.new(key: :exclude,
57-
description: 'One or more _fnmatch_-style patterns of tags to exclude from the search (maps to `git describe --exclude`). ' \
58-
'Can be a single string or an array of strings',
57+
description: 'An array of _fnmatch_-style patterns of tags to exclude from the search (maps to `git describe --exclude`)',
5958
optional: true,
6059
default_value: nil,
61-
is_string: false),
60+
type: Array),
6261
]
6362
end
6463

spec/find_previous_tag_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def stub_main_command(expected_command, stdout:, success: true)
7575
# Act
7676
tag = run_described_fastlane_action(
7777
pattern: 'v*',
78-
exclude: '*beta*'
78+
exclude: ['*beta*']
7979
)
8080
# Assert
8181
expect(tag).to eq('v1.7.3')
@@ -91,7 +91,7 @@ def stub_main_command(expected_command, stdout:, success: true)
9191
# Act
9292
tag = run_described_fastlane_action(
9393
pattern: 'v*',
94-
exclude: '*beta*'
94+
exclude: ['*beta*']
9595
)
9696
# Assert
9797
expect(tag).to eq('v1.7.3')

0 commit comments

Comments
 (0)