Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use an action in the same repo when the step is running in a container? #3620

Open
shink opened this issue Dec 12, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@shink
Copy link

shink commented Dec 12, 2024

Relevant issues:

Describe the bug

As the title stated, how to use an action in the same repo when the step is running in a container?

To Reproduce

Here is a minimal repro:

Repository file structure:

|-- hello-world (repository)
|   |__ .github
|       └── workflows
|           └── main-workflow.yml
|           └── sub-workflow.yml
|       └── actions
|           |__ hello-world-action
|               └── action.yml

main-workflow.yml:

jobs:
  main-job:
    uses: ./.github/workflows/sub-workflow.yml

sub-workflow.yml, which is a reusable workflow:

jobs:
  sub-job:
    runs-on: ${{ inputs.runner }}
    container:
      image: ${{ inputs.image }}
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Hello world
         uses: ./.github/actions/hello-world-action

Expected behavior

I expect that the hello-world action can be used correctly, but actually, It seems that GITHUB_WORKSPACE and github.workspace are different, and GitHub Actions tries to find my action in github.workspace.

The doc says:

The path is relative (./) to the default working directory (github.workspace, $GITHUB_WORKSPACE).

Runner Version and Platform

self-hosted runner

What's not working?

https://github.com/cosdt/pytorch-integration-tests/actions/runs/12295364230

image

Job Log Output

https://github.com/cosdt/pytorch-integration-tests/actions/runs/12295364230

Runner and Worker's Diagnostic Logs

@shink shink added the bug Something isn't working label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant