[Gitea Actions] Error on cloning local repo on steps #11660

Closed
opened 2025-11-02 09:43:45 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @sgabenov on GitHub (Sep 15, 2023).

Description

Hi, i want to set up my local actions for Act Runner \ Gitea Actions and use the same Gitea instance to store code for it. But when i want to checkout repo i got an authentication error. I try to use this article for configuration: 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

And specify action like this

name: Quick tests against our own repository
on:
  push:
jobs:
  cleanup_old_branches:
    runs-on: ubuntu
    name: Testing Actions
    steps:
      - name: Delete git repository old branches
        uses: emb_tools/gitea-actions-delete-abandoned-branches@v1
        id: delete_stuff
        with:
          repository: https://gitea.devos.club/
          ref: v1
          token: ${{ gitea.token }}
          path: ./.github/actions/my-private-repo

Action output:
zzz

Gitea Version

1.20.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker

Database

PostgreSQL

Originally created by @sgabenov on GitHub (Sep 15, 2023). ### Description Hi, i want to set up my local actions for Act Runner \ Gitea Actions and use the same Gitea instance to store code for it. But when i want to checkout repo i got an authentication error. I try to use this article for configuration: 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 And specify action like this ``` name: Quick tests against our own repository on: push: jobs: cleanup_old_branches: runs-on: ubuntu name: Testing Actions steps: - name: Delete git repository old branches uses: emb_tools/gitea-actions-delete-abandoned-branches@v1 id: delete_stuff with: repository: https://gitea.devos.club/ ref: v1 token: ${{ gitea.token }} path: ./.github/actions/my-private-repo ``` Action output: <img width="451" alt="zzz" src="https://github.com/go-gitea/gitea/assets/15741789/500a0194-8b4f-4842-9e41-b71b1c524468"> ### Gitea Version 1.20.0 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? docker ### Database PostgreSQL
GiteaMirror added the issue/needs-feedback label 2025-11-02 09:43:45 -06:00
Author
Owner

@lunny commented on GitHub (Sep 15, 2023):

The ${{ gitea.token }} have no enough permission to do that. You need to create an extra token to do that.

@lunny commented on GitHub (Sep 15, 2023): The ${{ gitea.token }} have no enough permission to do that. You need to create an extra token to do that.
Author
Owner

@sgabenov commented on GitHub (Sep 15, 2023):

@lunny i have created a token from user with full admin access and put into actions-secrets with name "GIT_ACCESS_TOKEN" then switched to

name: Quick tests against our own repository
on:
  push:
jobs:
  cleanup_old_branches:
    runs-on: ubuntu
    name: Testing Actions
    steps:
      - name: Delete git repository old branches
        uses: https://gitea.devos.club/emb_tools/gitea-actions-delete-abandoned-branches@v1
        id: delete_stuff
        with:
          repository: https://gitea.devos.club/
          ref: v1
          token: ${{ secrets.GIT_ACCESS_TOKEN }}
          path: ./.github/actions/my-private-repo

and got the very same behaviour:

h-jenkins-slave06.devos.club(version:v0.2.5) received task 653 of job 409, be triggered by event: push
workflow prepared
evaluating expression 'success()'
expression 'success()' evaluated to 'true'
  ☁  git clone 'https://gitea.devos.club/emb_tools/gitea-actions-delete-abandoned-branches' # ref=v1
  cloning https://gitea.devos.club/emb_tools/gitea-actions-delete-abandoned-branches to /opt/gitea_act_runner/.cache/act/https---gitea.devos.club-emb_tools-gitea-actions-delete-abandoned-branches@v1
Unable to clone https://gitea.devos.club/emb_tools/gitea-actions-delete-abandoned-branches refs/heads/v1: authentication required
authentication required
skipping post step for 'Delete git repository old branches'; step was not executed
Cleaning up services for job Testing Actions
Cleaning up container for job Testing Actions
🏁  Job failed
authentication required
@sgabenov commented on GitHub (Sep 15, 2023): @lunny i have created a token from user with full admin access and put into actions-secrets with name "GIT_ACCESS_TOKEN" then switched to ``` name: Quick tests against our own repository on: push: jobs: cleanup_old_branches: runs-on: ubuntu name: Testing Actions steps: - name: Delete git repository old branches uses: https://gitea.devos.club/emb_tools/gitea-actions-delete-abandoned-branches@v1 id: delete_stuff with: repository: https://gitea.devos.club/ ref: v1 token: ${{ secrets.GIT_ACCESS_TOKEN }} path: ./.github/actions/my-private-repo ``` and got the very same behaviour: ``` h-jenkins-slave06.devos.club(version:v0.2.5) received task 653 of job 409, be triggered by event: push workflow prepared evaluating expression 'success()' expression 'success()' evaluated to 'true' ☁ git clone 'https://gitea.devos.club/emb_tools/gitea-actions-delete-abandoned-branches' # ref=v1 cloning https://gitea.devos.club/emb_tools/gitea-actions-delete-abandoned-branches to /opt/gitea_act_runner/.cache/act/https---gitea.devos.club-emb_tools-gitea-actions-delete-abandoned-branches@v1 Unable to clone https://gitea.devos.club/emb_tools/gitea-actions-delete-abandoned-branches refs/heads/v1: authentication required authentication required skipping post step for 'Delete git repository old branches'; step was not executed Cleaning up services for job Testing Actions Cleaning up container for job Testing Actions 🏁 Job failed authentication required ```
Author
Owner

@harryzcy commented on GitHub (Sep 16, 2023):

Is the domain only available in local network? Does the runner machine have access to it?

@harryzcy commented on GitHub (Sep 16, 2023): Is the domain only available in local network? Does the runner machine have access to it?
Author
Owner

@sgabenov commented on GitHub (Sep 16, 2023):

The domain is on the same network with runner, the runner can communicate if i use checkout step

@sgabenov commented on GitHub (Sep 16, 2023): The domain is on the same network with runner, the runner can communicate if i use checkout step
Author
Owner

@sgabenov commented on GitHub (Sep 18, 2023):

I have figered out, that i can specify token within URL.
Providing env variables for repos did not work. Probably we should note this in documentation.

name: Quick tests against our own repository
on:
  push:
jobs:
  cleanup_old_branches:
    runs-on: slave06
    name: Testing Actions
    steps:
      - name: Delete git repository old branches
        uses: https://${{ secrets.GIT_ACCESS_TOKEN }}:@gitea.my.domain/emb_tools/gitea-actions-delete-abandoned-branches@v1
        id: delete_stuff
@sgabenov commented on GitHub (Sep 18, 2023): I have figered out, that i can specify token within URL. Providing env variables for repos did not work. Probably we should note this in documentation. ``` name: Quick tests against our own repository on: push: jobs: cleanup_old_branches: runs-on: slave06 name: Testing Actions steps: - name: Delete git repository old branches uses: https://${{ secrets.GIT_ACCESS_TOKEN }}:@gitea.my.domain/emb_tools/gitea-actions-delete-abandoned-branches@v1 id: delete_stuff ```
Author
Owner

@lunny commented on GitHub (Sep 19, 2023):

So you need to learn how to use emb_tools/gitea-actions-delete-abandoned-branches or you can send issue to them. Closed as it should be unrelated with Gitea. Please feel free to reopen it if there is new problem.

@lunny commented on GitHub (Sep 19, 2023): So you need to learn how to use `emb_tools/gitea-actions-delete-abandoned-branches` or you can send issue to them. Closed as it should be unrelated with Gitea. Please feel free to reopen it if there is new problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11660