Interview Prep/GitHub Actions/Reuse at Scale: Reusable Workflows & Actions

A composite action needs to run a script file that lives inside the action repo. How do you reference it?

BeginnerScenarioReuse at Scale: Reusable Workflows & Actions
Answer

Situation read → The working directory is the consumer's workspace, not the action's.

What I'd do →

  1. Use github.action_path:
    - run: ${{ github.action_path }}/scripts/check.sh
      shell: bash
    
  2. Or add it to PATH: echo "${{ github.action_path }}/scripts" >> "$GITHUB_PATH".

Why → Relative paths resolve against the consumer's repo and fail with "No such file".

Interview tip → GITHUB_ACTION_PATH is the env var equivalent.

All GitHub Actions questions Roadmap: GitHub Actions

More on Reuse at Scale: Reusable Workflows & Actions