Use Tencent Cloud SCF for a external trigger of Github Actions’ workflows
Inspired by https://zhuanlan.zhihu.com/p/379365305 [zh-SC]
- Automatically starts your Github workflows ON TIME and NO TIME LIMIT
- Support cron syntax
- All the variables are imported through secrets
- Automatically deletes workflow runs that have been successfully executed
- Low memory footprint (~ 20 MB)
- Python 3.6 +
- You should add the code below to your
.github/workflows/foo.yml.
on:
workflow_dispatch:- Sign up and login to Tencent Cloud SCF Console
- Click
函数服务which is located at left bar, Then click新建. - Click
从头开始, select运行环境asPython 3.6or higher. You can change your SCF name at函数名称. - Download the code from Releases, then select
提交方法as本地上传 zip 包. Upload the downloaded zip by click上传button. Or you can copy and paste the code into the editor fromindex.py. - Click
高级配置, Set your environment variables in环境变量:
| key | value |
|---|---|
| GITHUB_USER | Your username (e.g. nenekodev) |
| GITHUB_REPO | Your repo name (e.g. A-SOUL-Wecom-Notifier) |
| GITHUB_BRANCH | Your repo branch (e.g. main) |
| GITHUB_ACTION_FILE | Your workflow config (e.g. A-SOUL_BOT-RunOnce.yml) |
| GITHUB_TOKEN | Get it from here Name: GITHUB_TOKEN Scopes: repo, workflow, admin:repo_hook |
- (Optional)set
初始化超时时间to 300, set执行超时时间to 900. - Click
触发器配置, click自定义创建, choose your触发周期or select自定义触发周期and type cron expression atCron 表达式. Timezone is UTC +8 (Beijing, Shanghai, Chongqing, Urumuqi). - Then click
完成.
AGPL-3.0