Cant run Gitea Actions from private Repo #11294

Closed
opened 2025-11-02 09:33:35 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @Schrolli91 on GitHub (Jul 21, 2023).

Description

I have a private Repo with an example action.
Its totaly clear to me, that the runner can not clone this private repo without authentication.
So i use the checkout action with a personal access token and clone the action repo to the runner.
After that i try to run the action as follwing:

  - name: Check out repository code
    uses: actions/checkout@v3
    with:
      token: ${{ secrets.token }}
  - name: Hello world action step
    id: hello
    uses: ./

But this does not work.
I have seen, that the Github docs show exactly this tooling for private repos.
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow

Also i cant find any clear instructions or documentation, how to deal with private repos in actions on gitea.

Gitea Version

1.20.0

Operating System

Debian Linux

How are you running Gitea?

Running via docker in an debian Linux hosted inside a VPS (LXC)

Originally created by @Schrolli91 on GitHub (Jul 21, 2023). ### Description I have a private Repo with an example action. Its totaly clear to me, that the runner can not clone this private repo without authentication. So i use the checkout action with a personal access token and clone the action repo to the runner. After that i try to run the action as follwing: ```yaml - name: Check out repository code uses: actions/checkout@v3 with: token: ${{ secrets.token }} - name: Hello world action step id: hello uses: ./ ``` But this does not work. I have seen, that the Github docs show exactly this tooling for private repos. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow Also i cant find any clear instructions or documentation, how to deal with private repos in actions on gitea. ### Gitea Version 1.20.0 ### Operating System Debian Linux ### How are you running Gitea? Running via docker in an debian Linux hosted inside a VPS (LXC)
GiteaMirror added the topic/gitea-actionstype/bugissue/duplicate labels 2025-11-02 09:33:35 -06:00
Author
Owner

@wolfogre commented on GitHub (Jul 21, 2023):

Have you set a right secret with token as the name?

Actually, you don't need to do this. The runner will get a temporary token to checkout the repo even it's private. Please try again without with:

  - name: Check out repository code
    uses: actions/checkout@v3
@wolfogre commented on GitHub (Jul 21, 2023): Have you set a right secret with `token` as the name? Actually, you don't need to do this. The runner will get a temporary token to checkout the repo even it's private. Please try again without `with:` ```yaml - name: Check out repository code uses: actions/checkout@v3 ```
Author
Owner

@Schrolli91 commented on GitHub (Jul 21, 2023):

secret is set and it can clone successful - without it cant (login on gitea instance is required).
The runner maybe can checkout the "repo under test". But what happens if i want to use a action, that is hosted in another private repo?

This is the job from the github hello world action (https://github.com/actions/hello-world-docker-action), hosted on my own gitea server.
The folowing code will fail:
image

jobs:
  hello_world_job:
    runs-on: ubuntu-latest
    name: A job to say hello
    steps:
      - name: Check out repository code
        uses: actions/checkout@v3
      - name: Hello world action step
        id: hello
        uses: https://gitea..####/actions/hello-world-docker-action@main
        with:
          who-to-greet: 'test action'
      - name: Get the output time
        run: echo "The time was ${{ steps.hello.outputs.time }}"
@Schrolli91 commented on GitHub (Jul 21, 2023): secret is set and it can clone successful - without it cant (login on gitea instance is required). The runner maybe can checkout the "repo under test". But what happens if i want to use a action, that is hosted in another private repo? This is the job from the github hello world action (https://github.com/actions/hello-world-docker-action), hosted on my own gitea server. The folowing code will fail: ![image](https://github.com/go-gitea/gitea/assets/6043382/225e90b1-5027-46d8-b53e-ded5ce6539c7) ```yaml jobs: hello_world_job: runs-on: ubuntu-latest name: A job to say hello steps: - name: Check out repository code uses: actions/checkout@v3 - name: Hello world action step id: hello uses: https://gitea..####/actions/hello-world-docker-action@main with: who-to-greet: 'test action' - name: Get the output time run: echo "The time was ${{ steps.hello.outputs.time }}" ```
Author
Owner

@wolfogre commented on GitHub (Jul 21, 2023):

So the point is that your runner failed with uses: https://gitea..####/actions/hello-world-docker-action@main.

Now it's duplicated with #25929

@wolfogre commented on GitHub (Jul 21, 2023): So the point is that your runner failed with `uses: https://gitea..####/actions/hello-world-docker-action@main`. Now it's duplicated with #25929
Author
Owner

@Schrolli91 commented on GitHub (Jul 21, 2023):

Clone via Personal Access Token is working. This can show me the content of my repo:

steps:
  - name: Check out repository code
    uses: actions/checkout@v3
    with:
      token: ${{ secrets.token }}
  - name: show local dir
    run: ls -lah
  - name: Hello world action step
    id: hello
    uses: ./
    with:
      who-to-greet: 'Test Action'
  - name: Get the output time
    run: echo "The time was ${{ steps.hello.outputs.time }}"

So my main question is, why running a action from local cloned content is not possible on the runner?
Github can reference the local dir in the uses: directive. This seems not to work in Gitea - is this correct?

image

@Schrolli91 commented on GitHub (Jul 21, 2023): Clone via Personal Access Token is working. This can show me the content of my repo: ``` steps: - name: Check out repository code uses: actions/checkout@v3 with: token: ${{ secrets.token }} - name: show local dir run: ls -lah - name: Hello world action step id: hello uses: ./ with: who-to-greet: 'Test Action' - name: Get the output time run: echo "The time was ${{ steps.hello.outputs.time }}" ``` So my main question is, why running a action from local cloned content is not possible on the runner? Github can reference the local dir in the `uses:` directive. This seems not to work in Gitea - is this correct? ![image](https://github.com/go-gitea/gitea/assets/6043382/3b38ba5c-1265-4b48-b06c-12e75fff7d9a)
Author
Owner

@wolfogre commented on GitHub (Jul 21, 2023):

So my main question is, why running a action from local cloned content is not possible on the runner?

It is not supported yet.

@wolfogre commented on GitHub (Jul 21, 2023): > So my main question is, why running a action from local cloned content is not possible on the runner? It is not supported yet.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11294