🎉 DevOps Interview Prep Bundle is live — 1000+ Q&A across 20 topicsGet it →
All Fixes
Today I Fixed

GitHub Actions could not find action.yml for a local action

GitHub ActionsAug 22, 202612 minutes to fixgithub-actionscicdtroubleshooting

Problem

A workflow referenced a custom action stored in the same repository:

yaml
- name: Run deployment checks
  uses: ./.github/actions/deployment-check

The job failed with an error similar to:

text
Can't find 'action.yml', 'action.yaml' or 'Dockerfile'

The file existed at .github/actions/deployment-check/action.yml, so the path initially looked correct.

Root Cause

The workflow tried to run the local action before checking out the repository. Local action paths are resolved inside the runner workspace. Without actions/checkout, that workspace did not contain the repository files.

Fix

Checkout the repository before calling the local action:

yaml
jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
 
      - name: Run deployment checks
        uses: ./.github/actions/deployment-check

Then verify that the metadata file is located exactly where the uses path points:

text
.github/
  actions/
    deployment-check/
      action.yml

Paths on Linux runners are case-sensitive. Deployment-Check and deployment-check are different directories.

Additional Checks

If checkout is already present:

  1. Confirm checkout and the action run in the same job.
  2. Check whether actions/checkout uses a custom path; local uses must reflect that directory.
  3. Ensure sparse checkout includes .github/actions.
  4. Confirm action.yml is committed, not merely present locally.
  5. Do not add @branch to a relative local-action path.

Lesson

uses: ./path does not fetch an action. It loads files from the current runner workspace. Always checkout first, then reference the directory containing action.yml.

Source