# Unable to run workflow on Private/Internal repository

**URL:** <https://forum.gitea.com/t/unable-to-run-workflow-on-private-internal-repository/9160>\
**Category:** Actions\
**Created:** [May 17, 2024, 10:13pm UTC](https://forum.gitea.com/t/unable-to-run-workflow-on-private-internal-repository/9160 "2024-05-17T22:13:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikepziegler](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@mikepziegler](https://forum.gitea.com/u/mikepziegler)\
**Post date:** [May 17, 2024, 10:13pm UTC](https://forum.gitea.com/t/unable-to-run-workflow-on-private-internal-repository/9160/1 "2024-05-17T22:13:13Z")

</div>

Hello,

I have a Gitea Repository that is set to private. Now I want to run gitea workflow so I can deploy an app but each time I want to run the workflow I get a `fatal: unable to access 'https://[url]/[user]/[repository]/': The requested URL returned error: 403`

Here is my Gitea Workflow yml

```auto
name: Test 
on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository code
        uses: actions/checkout@v4

```

This is the log for checkout

```auto
::add-matcher::/run/act/actions/actions-checkout@v4/dist/problem-matcher.json
Syncing repository: [user]/[repository]
::group::Getting Git version info
Working directory is '/workspace/[user]/[repository]'
[command]/usr/bin/git version
git version 2.43.2
::endgroup::
Deleting the contents of '/workspace/[user]/[repository]'
::group::Initializing the repository
[command]/usr/bin/git init /workspace/[user]/[repository]
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint: git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint: git branch -m <name>
Initialized empty Git repository in /workspace/[user]/[repository]/.git/
[command]/usr/bin/git remote add origin https://[url]/[user]/[repository]
::endgroup::
::group::Disabling automatic garbage collection
[command]/usr/bin/git config --local gc.auto 0
::endgroup::
::group::Setting up auth
[command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
[command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/gitea\.***\.com\/\.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/gitea\.***\.com\/\.extraheader' && git config --local --unset-all 'http.https://[url]/.extraheader' || :"
[command]/usr/bin/git config --local http.https://[url]/.extraheader AUTHORIZATION: basic ***
::endgroup::
::group::Fetching the repository
[command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +a9eee5316026e471259bf372f5f50e1d79f3711b:refs/remotes/origin/main
remote: Interacting with repositories by HTTP protocol is not allowed
fatal: unable to access 'https://[url]/[user]/[repository]/': The requested URL returned error: 403
The process '/usr/bin/git' failed with exit code 128
Waiting 13 seconds before trying again
[command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +a9eee5316026e471259bf372f5f50e1d79f3711b:refs/remotes/origin/main
remote: Interacting with repositories by HTTP protocol is not allowed
fatal: unable to access 'https://[url]/[user]/[repository]/': The requested URL returned error: 403
The process '/usr/bin/git' failed with exit code 128
Waiting 18 seconds before trying again
[command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +a9eee5316026e471259bf372f5f50e1d79f3711b:refs/remotes/origin/main
remote: Interacting with repositories by HTTP protocol is not allowed
fatal: unable to access 'https://[url]/[user]/[repository]/': The requested URL returned error: 403
::remove-matcher owner=checkout-git::
::error::The process '/usr/bin/git' failed with exit code 128

```

What do I have to do, so that workflow can checkout the gitea repository? Do I have to add an ssh-key into the secret?

---

<div class="post-metadata">

**Author:** ![mikepziegler](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@mikepziegler](https://forum.gitea.com/u/mikepziegler)\
**Post date:** [May 18, 2024, 7:10am UTC](https://forum.gitea.com/t/unable-to-run-workflow-on-private-internal-repository/9160/2 "2024-05-18T07:10:59Z")

</div>

I have enabled `disable_http_git` and tried with a token and it worked. But I want to use an ssh key for it. When I used an ssh key it failed to clone the repository.

Here is the log:

```auto
[command]/usr/bin/git config --local http.https://[url]/.extraheader AUTHORIZATION: basic ***
::endgroup::
::group::Fetching the repository
[command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +26c856e98dba0078bf6ecc98aba8e670f926d213:refs/remotes/origin/main
No ED25519 host key is known for [url] and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The process '/usr/bin/git' failed with exit code 128

```

I’ve added the ssh-key under Profile \> Settings \> SSH-Key, added the private key as a secret and it still failed

---

<div class="post-metadata">

**Author:** ![mariusrugan](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@mariusrugan](https://forum.gitea.com/u/mariusrugan)\
**Post date:** [May 20, 2024, 10:02am UTC](https://forum.gitea.com/t/unable-to-run-workflow-on-private-internal-repository/9160/3 "2024-05-20T10:02:14Z")

</div>

What i would do is debug it from the runner

```yaml
    runs-on: ubuntu-22.04
    container:
      image: PULL-HERE-AN-PUB-IMAGE

...

    steps:

      - name: Debug
        shell: bash
        run: |
          sleep 3600

```

Hop onto the runner container and try to debug the git clone from there.

I am also using

```auto
      - name: Checkout
        uses: actions/checkout@v4

```

Also repo is private, **but** being cloned from **https://.**

EDIT

there is a lot of config related to ssh keys in

> **[GitHub - actions/checkout: Action for checking out a repo](https://github.com/actions/checkout)**
>
> Action for checking out a repo. Contribute to actions/checkout development by creating an account on GitHub.

are you using those ?
