Replies: 2 comments 3 replies
-
Yes, there is special handling for how To reference the
The Once you have referenced the Here is an example of how you can call the
In this example, the |
Beta Was this translation helpful? Give feedback.
-
@kthompson What you're trying to achieve doesn't appear to be documented anywhere. Having said that, you can clone the repository containing the reusable workflow and associated files in its own step, thereby making the files available to subsequent steps in the workflow: For example, given a repository named
And given a separate repository named
To access the JSON config file from the reusable workflow—given that it executes in the context of the calling workflow—clone the repository first1:
name: called-workflow
on:
workflow_call:
jobs:
called-workflow-job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: '<owner>/called-workflow-repo'
path: 'called-workflow-repo'
ref: 'main'
- name: Print config file
run: |
cat called-workflow-repo/.github/workflows/called-workflow-config.json The The calling workflow can be written simply as:
name: calling-workflow
on:
workflow_dispatch:
jobs:
calling-workflow-job:
uses: <owner>/called-workflow-repo/.github/workflows/called-workflow.yml@main Footnotes
|
Beta Was this translation helpful? Give feedback.
-
Reusable Workflows
General
Body
Given a file structure like below:
And
callerrepo/.github/workflows/default.yaml
calls the reusable workflowcalleerepo/.github/workflows/myworkflow.yaml
calleerepo/.github/workflows/myworkflow.yaml
depends oncalleerepo/.github/workflows/script.js
When
myworkflow.yaml
is called fromdefault.yaml
it says that the dependent filescript.js
isnt found.Is there special handling for how
myworkflow.yaml
should referencescript.js
? Currently it cannot detect the existence ofscript.js
.Beta Was this translation helpful? Give feedback.
All reactions