Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub Composite Actions: Can't find 'action.yml'

I am trying to create a composite action on my repo as follows:

.github
├── actions
│   └── setup-composite.yml
└── workflows
    └── composite_test.yml

the content of the files is the bare minumum

# setup-composite.yml

name: setup-env

runs:
  using: 'composite'
  steps:
    - uses: actions/setup-python@v4
      with:
        python-version: '3.9'

    - name: run dependencies
      shell: bash
      run: |
        pip install -r requirements.txt

and then I'm trying to reference the composite workflow using

# composite_test.yml

name: Composite Test
on:
  pull_request:
  push:
    branches: [main]
  workflow_dispatch:

jobs:
  setup:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: composite
        uses: ./.github/actions/setup-composite

The contents of requirements.txt are just a couple of packages for testing purposes.

But when this workflow runs I get Error: Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/home/runner/work/_actions/{profile}/{repo}/main/.github/actions/setup-composite'. Did you forget to run actions/checkout before running your local action?

As far as I know I followed all the steps from the Docs. I also looked at multiple other answers, including

  • Error in github action from usethis package Can't find 'action.yml', 'action.yaml' or 'Dockerfile'

  • How can I reference other actions from my GitHub Action's action.yml file?

  • How can I reference other actions from my GitHub Action's action.yml file?

and multiple threads on the GitHub discussion board.

My repo is public. I tried several combinations of the uses: ./.github/actions/setup-composite statement, including referencing by branch, but I ran out of ideas to try.

like image 822
thenewjames Avatar asked Sep 12 '25 11:09

thenewjames


1 Answers

Composite actions have to be defined with action.yml.

I have done something similar, try this layout:

.github
├── actions
│   └── setup-composite
│      └── action.yml
└── workflows
    └── composite_test.yml
like image 181
aknosis Avatar answered Sep 15 '25 01:09

aknosis