我不确定是否可能,但我试图在同一调用工作流程的另一个可重用工作流程中使用输出。请参考以下配置:
调用者工作流程:
jobs:
call-workflow-calver:
uses: ./.github/workflows/called-workflow1.yaml
secrets: inherit
call-workflow-echo:
needs: call-workflow-calver
uses: ./.github/workflows/called-workflow2.yaml
secrets: inherit
创建CalVer标签的工作(它作为操作的一部分输出为
$VERSION
)。
调用工作流1:
...
jobs:
calver:
name: Create CalVer tag
...
steps:
- name: Calver tag
uses: StephaneBour/actions-calver@1.4.4
if: ${{ github.ref == 'refs/heads/main' }}
id: calVer
with:
date_format: "%Y-%m-%d"
release: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
...
尝试在其他调用工作流中使用CalVer $VERSION输出 被调用的工作流2:
...
- name: Echo
run: |
echo ${{needs.calver.outputs.VERSION}}
...
基本概念是我试图在第一个可重用的工作流程中使用输出,在第二个工作流程中设置CalVer版本,以使其成为图像版本。 最终,我将在第三个可重用的工作流程中部署指定的图像。 如果可能,那就太好了!希望这一切都有点意义,但如果需要澄清任何事情,请告诉我!非常感谢!