作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我希望我的 repo 有两个功能:
name: "Upload a Release Asset"
description: "Upload a release asset to an existing release on your repository"
author: "Github"
inputs:
upload_url:
description: "The URL for uploading assets to the release"
required: true
asset_path:
description: "The path to the asset you want to upload"
required: true
asset_name:
description: "The name of the asset you want to upload"
required: true
asset_content_type:
description: "The content-type of the asset you want to upload. See the supported Media Types here: https://www.iana.org/assignments/media-types/media-types.xhtml for more information"
required: true
outputs:
browser_download_url:
description: "The URL users can navigate to in order to download the uploaded asset"
runs:
using: "node12"
main: "dist/index.js"
branding:
icon: "package"
color: "gray-dark"
name: 'Hello World'
description: 'Greet someone and record the time'
inputs:
who-to-greet: # id of input
description: 'Who to greet'
required: true
default: 'World'
outputs:
time: # id of output
description: 'The time we greeted you'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.who-to-greet }}
最佳答案
@成和潘!如果您想在同一个存储库中有两个操作,它们应该位于不同的目录中。
但是,action.yml
文件不是必需的。
如果您计划在 GitHub Marketplace 中列出某个操作,则该文件仅需要该文件。
如果您在同一个 repo 中有这些操作,则它们可以拥有自己的 action.yml
文件以及它们的 Dockerfile 或节点脚本。这是一个包含两个 dockerfile 的示例:
.
├── README.md
├── .github
│ └── workflows
│ └── main.yml
├── action1
│ ├── Dockerfile
│ ├── action.yml
│ └── entrypoint.sh
└── action2
├── Dockerfile
├── action.yml
└── entrypoint.sh
name: Test two actions
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ./action1
- uses: ./action2
name: Test two actions
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: managedkaos/github-actions-two-actions/action1@master
- uses: managedkaos/github-actions-two-actions/action2@master
action.yml
文件放在与操作相同的目录中,就可以了!
关于github-actions - 如何在一个 repo 中合并两个 action.yml 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59259783/
我是一名优秀的程序员,十分优秀!