然后,在你的其他仓库中的 .github/workflows 目录下你可以创建一个 workflow build.yml 指向该文件,例如: name: Build on: push: pull_request: workflow_dispatch: jobs: call-build: uses: shenxianpeng/reuse-workflows-demo/.github/workflows/build.yml@main with: target: stage 更多关于 Reusable Workflow...
AI代码解释 name:Buildon:workflow_call:inputs:target:required:truetype:stringdefault:""jobs:build:strategy:matrix:target:[dev,stage,prod]runs-on:ubuntu-lateststeps:-name:inputs.target=${{inputs.target}}if:inputs.targetrun:echo"inputs.target = ${{ inputs.target }}."-name:matrix.targe=${{...
on: workflow_call: 如果是在 .github/workflows的子目录下,则不需要额外指定。 可以在reuseable workflow定义inputs,inputs可以从调用者的workflow中传递参数: inputs: save_cache: description: 'whether to save ccache to github action cache' required: true os: description: 'which runner os to run this...
Github Action 作为代码仓库的持续集成工具,允许我们创建自定义的工作流来自动化软件开发过程中的任务。 但是,如果多个仓库有相同的工作流需求,在每个仓库中定义完全相同的工作流就很麻烦,且不利于后期的维护。 Github Action 提供了可复用工作流功能,可以将工作流定义为独立的 YAML 文件,存储在公共仓库中,其他仓库可以...
on.workflow_call.secrets 的示例 on: workflow_call: secrets: access-token: description: 'A token passed from the caller workflow' required: false jobs: pass-secret-to-action: runs-on: ubuntu-latest steps: # passing the secret to an action - name: Pass the received secret to an act...
workflow_call: inputs: # pass in environment through manual trigger, if not passed in, default to 'dev' env: required: true type: string default: 'dev' # working-directory is added to accommodate monorepo. For multi repo, defaults to '.', current directory ...
workflow_call workflow_dispatch workflow_run 关于触发工作流程的事件工作流程触发器是导致工作流程运行的事件。 有关如何使用工作流触发器的详细信息,请参阅“触发工作流程”。某些事件具有多种活动类型。 对于这些事件,你可以指定将触发工作流程运行的活动类型。 有关每个活动类型的含义的详细信息,请参阅“Webhook 事...
GitHub 的 workflow 和 action 存在着一些注意事项,包括 workflow 的 yaml 配置,action 的脚本编写,以及对应的 branch 的保护设置,总结如下,以供参考 Workflow on.issues.types 如果需要判断 label,不需要指定opened,只需要指定labeled,因为即使 label 是新建时设置的,也会触发labeled ...
name字段是 workflow 的名称。如果省略该字段,默认为当前 workflow 的文件名。name: GitHub Actions Testonon字段指定触发 workflow 的条件,通常是某些事件。on: push上面代码指定,push事件触发 workflow。 on字段也可以是事件的数组。on: [push, pull_request]上面代码指定,push事件或pull_request事件都可以触发 ...
Action 基础Github Actions常用Action介绍actions/checkout@v2actions/checkout@v2: 进入到被推送的代码下仓库内容。通常需要以来仓库内容的时候加入,比如:...