Skip to content

Use Tencent Cloud SCF for a external trigger of Github Actions’ workflows

License

Notifications You must be signed in to change notification settings

nenekodev/Github-Actions-Trigger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Github-Actions-Trigger

Use Tencent Cloud SCF for a external trigger of Github Actions’ workflows

Inspired by https://zhuanlan.zhihu.com/p/379365305 [zh-SC]

Features

  • 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)

System Requirements

  • Python 3.6 +

Usage

  1. You should add the code below to your .github/workflows/foo.yml.
on:
  workflow_dispatch:
  1. Sign up and login to Tencent Cloud SCF Console
  2. Click 函数服务 which is located at left bar, Then click 新建.
  3. Click 从头开始, select 运行环境 as Python 3.6 or higher. You can change your SCF name at 函数名称.
  4. 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 from index.py.
  5. 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
  1. (Optional)set 初始化超时时间 to 300, set 执行超时时间 to 900.
  2. Click 触发器配置, click 自定义创建, choose your 触发周期 or select 自定义触发周期 and type cron expression at Cron 表达式. Timezone is UTC +8 (Beijing, Shanghai, Chongqing, Urumuqi).
  3. Then click 完成.

License

AGPL-3.0

About

Use Tencent Cloud SCF for a external trigger of Github Actions’ workflows

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages