当前位置: 首页 > ds >正文

Github Actions Workflows 上传 Dropbox

一、注册

  • 访问 https://www.dropbox.com/register
  • 选择 "个人"

  • 如果想免费使用,一定要选择 “继续使用2GB的Dropbox Basic 套餐”,如下:

二、在 Dropbox 中 创建app

  • 需要去注册的邮箱中验证一下邮箱.
  • 访问 https://www.dropbox.com/developers/apps 创建app
  • 按下面的配置进行设置, Name your app 是全平台唯一的,在我们的场景中没有特别意义,所以随便起一个唯一的就好
  • 在app 的 Permissions里添加权限
  • 在 app 的 Settings里设置

      三、生成 refresh token

      • 1. 浏览器中访问下面的url,将${YOUR_APP_KEY}将成自己的app key.
      https://www.dropbox.com/oauth2/authorize?client_id=${YOUR_APP_KEY}&response_type=code&token_access_type=offline
      • 2. 访问后会提示

        继续,会提示

        允许 得到一个 authorization code(下图中的马赛克部分),下步中会用到

        • 3. 使用 curl 或者 python 脚本 请求 refresh token,将 ${AUTHORIZATION_CODE}, ${YOUR_APP_KEY}, ${YOUR_APP_SECRET} 替换成对应的值。
        curl https://api.dropbox.com/oauth2/token -d code=${AUTHORIZATION_CODE} -d grant_type=authorization_code -d client_id=${YOUR_APP_KEY} -d client_secret=${YOUR_APP_SECRET}

        发送请求后将得到如下响应, 将 refresh_token 保存

        {"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","token_type": "bearer",..."refresh_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","account_id": "xxxxxxxxx","uid": "xxxxxxxx"
        }

        四、保存相关信息

        1. DROPBOX_APP_KEY: app key
        2. DROPBOX_APP_SECRET: app secret
        3. DROPBOX_REFRESH_TOKEN: refresh token

        五、使用 Lewuathe/dropbox-github-action 上传

              - name: Upload file to Dropboxuses: Lewuathe/dropbox-github-action@v1.0.3with:dropbox-app-key: ${{ secrets.DROPBOX_APP_KEY }}dropbox-app-secret: ${{ secrets.DROPBOX_APP_SECRET }}dropbox-refresh-token: ${{ secrets.DROPBOX_REFRESH_TOKEN }}source-path: /path/source-filetarget-path: /path/target-filewrite-mode:  "overwrite"

        http://www.xdnf.cn/news/15895.html

        相关文章:

      1. 【C++】初识C++(2)
      2. 【RK3576】【Android14】UART开发调试
      3. 微信小程序入门实例_____从零开始 开发一个“旅行清单 ”微信小程序
      4. 微信小程序——世界天气小助手
      5. 【EMC设计基础--信号环路分析、PCB设计规则】
      6. VSCode - VSCode 查找中文字符
      7. LVS工作模式和算法的总结
      8. 【RK3576】【Android14】SDK源码编译
      9. 前端 SSE 实战应用:用最简单的方式实现实时推送
      10. Android CountDownTimer
      11. 深入理解Linux文件I/O:系统调用与标志位应用
      12. 机器学习17-Mamba
      13. c++继承详解
      14. 【Leecode 随笔】
      15. 使用python的读取xml文件,简单的处理成元组数组
      16. 【时时三省】(C语言基础)通过指针引用字符串
      17. PyCharm 高效入门指南(核心模块详解二)
      18. stm32f4 dma的一些问题
      19. API和SDK有何区别??
      20. 跨平台猫咪键盘桌宠BongoCat v0.6.2 绿色版(附带多款皮肤包)
      21. SDIO协商,枚举,CMD等概念
      22. [特殊字符] Spring Boot 常用注解全解析:20 个高频注解 + 使用场景实例
      23. 前端篇——番外篇 Bootstrap框架
      24. (笔记+作业)第五期书生大模型实战营---L2G2000 GraphGen:训练数据合成实践
      25. 前端之CSS
      26. LP-MSPM0G3507学习--04GPIO控制
      27. 磁悬浮转子不平衡质量的高精度控制:从原理到实战
      28. 一文讲清楚React的render优化,包括shouldComponentUpdate、PureComponent和memo
      29. Android音视频探索之旅 | Webrtc 1对1音视频通话核心流程分析
      30. 借助AI学习开源代码git0.7之三git-init-db