下面是我的代码,我需要检查变量是否以“QA_”开头,谢谢您的提前赞赏。
desc "CREATE BUILD BY TAG"
lane :createBuildByTag do |options|
env = options[:env]
# if env == "QA_0.0"
# contains not working for below line
if options[:env].contains("QA_")
gradle(task: "clean assemblePreStageDebug")
upload_drive(options)
end
end
# Note- I am calling above method by below command
- name: upload driveStageAPK to Google Drive
run: bundle exec fastlane createBuildByTag env:"${{ github.ref_name }}"
#QA_9.9.1
您是在 Fastfile 中编写 Ruby 代码还是使用 Java 来检查字符串匹配的模式?
如果是前者,您要查找的函数是 include()
那么,
`...
if env && env.include?("QA_")
#rest of code
...
`