我有這個 Github Action,它同時使用兩個不同的動作job:
name: My workflow
on:
workflow_dispatch:
jobs:
my-workflow:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.17
- name: X Action
uses: x-action/x-action@main
with:
file: x-action.txt
- name: Y Action
uses: y-action/y-action@main
with:
file: y-action.txt
這兩個輸入file會導致問題,因為 Github Actions 只考慮第一個。查看 Action 的組合內部,他們使用${{inputs.<inputs_name>}}.
我認為這是一個大問題,因為很多操作在inputs輸出、路徑、鍵等中使用了一些默認名稱。
也許還有另一種方式來指定${{inputs.<inputs_name>}},但我不知道。
uj5u.com熱心網友回復:
這根本不會是問題。
復合動作有自己的inputs作用域。您唯一需要注意的是${{ inputs.file }}在復合動作中使用,而不是在全域動作中使用github.inputs.file——一切都會好起來的。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/443660.html
