你可以指定单个事件(如on: push)、事件数组(如on: [push, pull_request])或事件配置映射(用于计划工作流或将工作流的执行限制为特定文件、标记或分支更改)。 映射可能如下所示: yml复制 on:# Trigger the workflow on push or pull request,# but only for the main branchpush:branches:-m...
on:# Trigger the workflow on push or pull request,# but only for the main branchpush:branches:-mainpull_request:branches:-main# Also trigger on page_build, as well as release created eventspage_build:release:types:# This configuration does not affect the page_build event ab...
# Triggers the workflow on push or pull request events on: [push, pull_request] 示例:使用具有活动类型或配置的多个事件 如果您需要为一个事件指定活动类型或配置,必须分别配置每个事件。 您必须为所有事件附加冒号 (`:</0),包括没有配置的事件。 on: # Trigger the workflow on push or pull request...
Aneventis a specific activity in a repository that triggers aworkflowrun. For example, an activity can originate from GitHub when someone creates a pull request, opens an issue, or pushes a commit to a repository. You can also trigger a workflow to run on aschedule, byposting to a REST ...
For more information, see "GitHub Actions 的工作流语法." on: [push] Specifies the trigger for this workflow. This example uses the push event, so a workflow run is triggered every time someone pushes a change to the repository or merges a pull request. This is triggered by a...
name:GreetEveryone# This workflow is triggered on pushes to the repository.on:[push]jobs:your_job_id:# Job name is Greetingname:Greeting# This job runs on Linuxruns-on:ubuntu-latest steps:# This step uses GitHub's hello-world-javascript-action: https://github.com/actions/hello-world-javasc...
An event is a specific activity in a repository that triggers a workflow run. For example, an activity can originate from GitHub when someone creates a pull request, opens an issue, or pushes a commit to a repository. You can also trigger a workflow to run on a schedule, by posting...
GitHub Actions 的配置文件叫做 workflow 文件,存放在代码仓库的.github/workflows目录。 workflow 文件采用YAML格式,文件名可以任意取,但是后缀名统一为.yml,默认为main.yml。一个库可以有多个 workflow 文件。GitHub 只要发现.github/workflows目录里面有.yml文件,就会自动运行该文件。
on: # Triggers the workflow on push or pull request events but only for the main branch push: branches: [ main ] pull_request: branches: [ main ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: # A workflow run is made up of one or more jobs tha...
name: GitHub Pages on: push: branches: - main # Set a branch name to trigger deployment pull_request: jobs: deploy: runs-on: ubuntu-22.04 permissions: contents: write concurrency: group: ${{ github.workflow }}-${{ github.ref }} steps: - uses: actions/checkout@v4 with: submodules: ...