jenkins - github 操作 - 结帐操作中的问题
问题描述
我是 github 动作跑步者的新手。我从 master 创建了一个 test-master 分支,另一个特性分支也从 master test-feature 中取出。我的 test-master 分支有一个与 terraform 相关的工作流程。但是,我在 git checkout 操作 PFB 代码和错误中遇到错误。
name: 'Terraform'
on: [pull_request]
jobs:
terraform:
name: 'Terraform'
runs-on: ubuntu-latest
# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest
defaults:
run:
shell: bash
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@test-master
# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc.
- name: Terraform Init
run: terraform init
# Checks that all Terraform configuration files adhere to a canonical format
- name: Terraform Format
id: fmt
run: terraform fmt --recursive
每当我尝试从 test-feature 向 test-master 提出拉取请求时,它都会运行工作流程并生成错误。错误:无法解析操作actions/checkout@test-master
,无法找到版本test-master
请指导我为什么它不识别 test-maser 分支。
解决方案
当您要使用操作时,您需要指定操作名称和要运行的操作版本。这一行:
- uses: actions/checkout@test-master
表示您要使用actions/checkout
version 的操作test-master
。没有这样的行动版本。
你想要actions/checkout@v2
。如果要检查名为的分支test-master
,请将其指定为操作的选项。例如:
- name: Checkout
uses: actions/checkout@v2
with:
ref: 'test-master'
推荐阅读
- python - 根据 numpy histogram 返回的 bin 将数组拆分为数据
- r - 需要 R Markdown Pandoc 1.12.3 或更高版本
- solace - 无法使用 JavaRTO API 为句柄创建会话
- c++ - 为什么会这样编译?[C++]
- c++ - 返回默认构造对象是否会阻止 NRVO?
- c# - xml XElement 显示空指针异常
- c# - 在视图控制器中添加剃刀变量?
- json - Swift - 在发布请求时将参数添加到 httpBody
- c# - C# WebAPI 返回 JSON 数据
- xamarin - Xamarin - 有什么方法可以将可视状态管理器定义放入 ResourceDictionary