我正在尝试使用faSTLane在android dev中实现CD,以便将我的apk上载到一些松弛的 channel 上,我曾经制作过一个notif系统,并且运行良好,但是当我尝试制作apk发行商时,出现了这个错误:
{"ok":false,"error":"missing_scope","needed":"files:write","provided":"incoming-webhook"}
看起来api需要其他东西,我给范围权限如下,但它不起作用:
这是FastFile中的 ruby 脚本,我用于生成APK并将其上传到松弛 channel
lane :slack_build do
gradle(task: "assembleRelease")
slack(message: "Build Successful!")
upload_to_slack()
end
# Add this to your Fastfile
desc "Upload the APK to Slack channel"
private_lane :upload_to_slack do |options|
file_path = lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]
file_name = file_path.gsub(/\/.*\//,"")
access_token = "xoxb-961296623494-963876433841-c1PkVmqWSBbDUkbmnbvku4vK"
channel_name = "test_android_sample"
sh "echo Uploading " + file_name + " to Slack"
sh "curl https://slack.com/api/files.upload -F token=\"" + access_token + "\" -F channels=\"" + channel_name + "\" -F title=\"" + file_name + "\" -F filename=\"" + file_name + "\" -F file=@" + file_path
end
最佳答案
似乎我只需要从api-slack网站顶部的黄色警告重新安装应用程序,简单又容易:(
关于java - 通过FaSTLane在Slack API中的missing_scope for android CD,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/60465486/