-
Notifications
You must be signed in to change notification settings - Fork 66.2k
Closed
Labels
contentThis issue or pull request belongs to the Docs Content teamThis issue or pull request belongs to the Docs Content team
Description
Code of Conduct
- I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/actions/using-workflows/reusing-workflows
What part(s) of the article would you like to see updated?
https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations
You cannot use a reusable workflow from another repository if it uses a composite action. For more information, see "About custom actions."
That said, turns out it's possible to do - below are the details of testing:
Composite action:
# .github/actions/test/action.yml
name: Test
on:
workflow_call:
inputs:
foo:
type: string
description: Foo
required: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Echo
run: echo "Hello from reusable workflow! inputs.foo=${{ inputs.foo }}"
- name: Run composite action
uses: micnncim/test-gha-composite-action/.github/actions/test@main
with:
foo: ${{ inputs.foo }}Reusable workflow:
# .github/workflows/_test.yml
name: Test
on:
workflow_call:
inputs:
foo:
type: string
description: Foo
required: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Echo
run: echo "Hello from reusable workflow! inputs.foo=${{ inputs.foo }}"
- name: Run composite action
uses: micnncim/test-gha-composite-action/.github/actions/test@main
with:
foo: ${{ inputs.foo }}Workflow using the reusable workflow:
# .github/workflows/test.yml
name: Test
on:
workflow_dispatch:
inputs:
foo:
description: Foo
required: true
jobs:
test:
uses: micnncim/test-gha-composite-action/.github/workflows/_test.yml@main
with:
foo: ${{ github.event.inputs.foo }}Workflow run result:
The repositories used for the testing are available on micnncim/test-gha-composite-action and micnncim/test-gha-reusable-workflow.
Additional information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
contentThis issue or pull request belongs to the Docs Content teamThis issue or pull request belongs to the Docs Content team
