- name: checkout # name是指定当前工作的名称 在workflow(工作流)文件的steps中,每个用‘-’代替缩进视为一个步骤的开始 uses: actions/checkout@v2 # uses字段是选择一个可以直接复用的action,并且在github action store中的action可以直接使用,不需要下载 - name: setting env id: setting # id 是步骤的唯...
name: my actionon: pull_request_targetjobs: pr-check: name: Check PR runs-on: ubuntu-latest steps: - name: Setup Action uses: actions/checkout@v3 with: ref: ${{github.event.pull_request.head.ref}} repository: ${{github.event.pull_request.head.repo.full_name...
"-run:echo " The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."-name:Check out repository codeuses:actions/checkout@v3-run:echo " The ${{ github.repository }} repository has been cloned to the runner."-run:echo " ️ The workflow is...
通常,当人们在GitHub上创建自己的工作流时,他们会直接使用由他人创建的Actions。例如,几乎所有的工作流程都会从如下步骤开始: 复制 YAML - name: Check out repository uses: actions/checkout@v3 而多数人可能认为这只是在获取自己的代码,没什么危险的。不过,让我们来研究一下它是如何检查目标代码的:以“uses”开头...
uses:actions/checkout@v3 # 建一个名为setup-node的步骤(安装指定版本的Node.js)-name:setup-node # 使用setup-node@v3这个action uses:actions/setup-node@v3 # 指定某个action 可能需要输入的参数with:node-version:'16.x'# 安装 pnpm-name:Install pnpm ...
作业中的steps使用 GitHub Actionsactions/checkout@v3操作将代码从存储库导入到 VM,使用actions/setup-node@v3操作设置正确版本的 Node.js。 我们指定要用${{ matrix.node-version }}属性测试 Node.js 的三个版本。 此属性引用我们之前定义的矩阵。cache属性指定用于在默认目录中缓存的包管理器。
name: hello-github-actions#触发 workflow 的事件on: push:#分支随意branches:-master#一个workflow由执行的一项或多项jobjobs:#一个job任务,任务名为buildbuild:#运行在最新版ubuntu系统中runs-on: ubuntu-latest#步骤合集steps:#新建一个名为checkout_actions的步骤-name: checkout_actions#使用checkout@v2这个ac...
-uses:actions/checkout@v4with:ref:${{ github.event.pull_request.head.sha }} on:pull_request:branches:[main]types:[opened, synchronize, closed]jobs:build:runs-on:ubuntu-lateststeps: -uses:actions/checkout@v4 Push a commit using the built-in token ...
name:build_deploy_akson:push:paths:-"azure-vote/**"jobs:build:runs-on:ubuntu-lateststeps:- name:Checkoutsourcecodeuses:actions/checkout@v3- name:ACRbuildid:build-push-acruses:azure/acr-build@v1with:service_principal:${{secrets.service_principal}}service_principal_password:${{secrets.service_...
新建github actions 配置文件: .github\workflows\test-deploy.yml 代码语言:txt 复制 - 仓库的 .github/workflows 目录中定义将会被 github actions 识别 - 测试可以用,生产则可以用 `on: workflow_dispatch` 指定手动构建拉取分支 代码语言:txt 复制 - actions 库:`actions/checkout@v3`安装 node v18.17.1 ...