# **What it does**: Build and deploy static site to Weixin Cloudrun. on: workflow_dispatch: push: branches: - main # 监听的分支,可以根据自己项目情况修改 pull_request: permissions: contents: read # Needed for the 'trilom/
下文将按照 workflow 的顺序,对每个环节进行逐一介绍。 1. 触发 用于触发 workflow 的配置如下: on: workflow_dispatch: pull_request: 说明: on.workflow_dispatch:表示该 workflow 可以手动触发,不过 GitHub 限制该 workflow 必须位于默认分支上才可以手动触发,并且也只会在默认分支上生效。 on.pull_request:表示当...
on:check_run:types:[rerequested,requested_action] Repository_dispatch repository_dispatch是 GitHub Actions 中的自定义事件,它允许外部系统(甚至其他 GitHub 工作流)通过向 GitHub API 发送 POST 请求来手动触发工作流。 它实现灵活的自动化,并能与需要启动存储库中工作流的外部工具、脚本或系统集成。
首先新建一个workflow,最基本的workflow文件长这样: name:CI # workflow名,会显示在action界面中on:# 定义触发器workflow_dispatch:# 手动触发schedule:# 周期触发-cron:'0 14 * * 5'# 利用cron实现时间,注意是UTC时间# 当有对main分支的push和pr提交时自动执行push:branches:["main"]pull_request:branches:["...
1. workflow 执行时,传入参数 在执行 workflow 时, 允许在 GitHub Actions 页面输入参数,控制执行逻辑。我们可以将人工处理的逻辑,在 GitHub Actions 参数化执行,适用于持续部署场景。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 on: workflow_dispatch: inputs: logLevel: description: 'Log level' re...
在GitHub Action YAML文件中增加设置权限操作: name: Add to Journal on: workflow_dispatch: inputs: text: description: Add a single item to Logseq journal type: string required: true permissions: write-all # 新增设置权限步骤,以确保可以执行git push ...
1. workflow 执行时,传入参数 在执行 workflow 时, 允许在 GitHub Actions 页面输入参数,控制执行逻辑。我们可以将人工处理的逻辑,在 GitHub Actions 参数化执行,适用于持续部署场景。 复制 on:workflow_dispatch:inputs:logLevel:description:'Log level'required:truedefault:'warning'tags:description:'Test scenario...
Workflow dispatch inputs are specified with the same format as action inputs. For more information about the format see "Metadata syntax for GitHub Actions." on: workflow_dispatch: inputs: logLevel: description: 'Log level' required: true default: 'warning' tags: description: 'Test scenario ...
Workflow 是由一个或多个 job 组成的可配置的自动化过程。可以自定义名称,Github Action页面就会显示自定义的名称,否则用默认的命名方式。 on 可以定义 触发 Workflow 执行的 event 名称。下面是最常用的两种。 代码语言:javascript 代码运行次数:0 运行
GitHub Action for Dispatching Workflows This action triggers another GitHub Actions workflow, using theworkflow_dispatchevent. The workflow must be configured for this event type e.g.on: [workflow_dispatch] This allows you to chain workflows, the classic use case is have a CI build workflow, tr...