【问题标题】:getting default working directory from caller workflow to reusable workflowgetting default working directory from caller workflow to reusable workflow
【发布时间】:2022-12-02 08:18:33
【问题描述】:

I wanted to pass the below directory name(myfolder/python/serviceA) from the caller work flow to the reusable workflows directory. Please let me know hoe can I achieve this?

caller workflow

    defaults:
      run:
        working-directory: myfolder/python/serviceA

..

..
jobs:
  reusable-job:
    uses: <owner>/<repo>/.github/workflows/<reusable workflow>@master
    with:
      working-directory: {{ deafults.working-directory }} # something like this

this working directory should be available in the reusable workflow

on:
  workflow_call:
    inputs:
      working-directory:
        required: true
....
...
    defaults:
      run:
        working-directory: {{ inputs.working-directory }}#something like this

【问题讨论】:

    标签: github github-actions


    【解决方案1】:

    You need to make sure your first step in thereusableworkflow is - uses: actions/checkout@v3 and then the default working-directory inside a reusable workflow should work

    【讨论】:

      猜你喜欢
      • 2022-11-08
      • 2012-09-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-27
      • 1970-01-01
      • 2022-12-02
      相关资源
      最近更新 更多