Fix CI git authentication #9

Closed
opened 2023-07-20 02:15:06 +00:00 by roysc · 5 comments
Member

Integration tests are failing due a problem with the basic auth headers.
See https://git.vdb.to/cerc-io/plugeth-statediff/actions/runs/72/jobs/1

::group::Setting up auth
[command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
[command]/usr/bin/git submodule foreach --recursive 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\:\/\/git\.vdb\.to\/\.extraheader
[command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/git\.vdb\.to\/\.extraheader' && git config --local --unset-all 'http.https://git.vdb.to/.extraheader' || :
[command]/usr/bin/git config --local http.https://git.vdb.to/.extraheader AUTHORIZATION: basic ***
::endgroup::
::group::Fetching the repository
[command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/main*:refs/remotes/origin/main* +refs/tags/main*:refs/tags/main*
remote: User permission denied
fatal: unable to access 'https://git.vdb.to/cerc-io/system-tests/': The requested URL returned error: 403
The process '/usr/bin/git' failed with exit code 128

Integration tests are failing due a problem with the basic auth headers. See https://git.vdb.to/cerc-io/plugeth-statediff/actions/runs/72/jobs/1 ``` ::group::Setting up auth [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand [command]/usr/bin/git submodule foreach --recursive 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\:\/\/git\.vdb\.to\/\.extraheader [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/git\.vdb\.to\/\.extraheader' && git config --local --unset-all 'http.https://git.vdb.to/.extraheader' || : [command]/usr/bin/git config --local http.https://git.vdb.to/.extraheader AUTHORIZATION: basic *** ::endgroup:: ::group::Fetching the repository [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/main*:refs/remotes/origin/main* +refs/tags/main*:refs/tags/main* remote: User permission denied fatal: unable to access 'https://git.vdb.to/cerc-io/system-tests/': The requested URL returned error: 403 The process '/usr/bin/git' failed with exit code 128 ```
Owner

This may be the same problem as with go fetch accessing a repo on the same gitea -- the git token issued to a CI job is only valid for the host repo. To clone another repo on the same gitea will need a similar solution to the one we used for go recently.

This may be the same problem as with go fetch accessing a repo on the same gitea -- the git token issued to a CI job is only valid for the host repo. To clone another repo on the same gitea will need a similar solution to the one we used for go recently.
Member

I think all you need to do is add the token to the appropriate actions/checkout step:

      - name: "Clone system-tests"
        uses: actions/checkout@v3
        with:
          repository: cerc-io/system-tests
          ref: main
          path: ./system-tests
          token: ${{ secrets.CICD_REPO_TOKEN }}
I think all you need to do is add the `token` to the appropriate `actions/checkout` step: ``` - name: "Clone system-tests" uses: actions/checkout@v3 with: repository: cerc-io/system-tests ref: main path: ./system-tests token: ${{ secrets.CICD_REPO_TOKEN }} ```
Author
Member

I think all you need to do is add the token to the appropriate actions/checkout step:

      - name: "Clone system-tests"
        uses: actions/checkout@v3
        with:
          repository: cerc-io/system-tests
          ref: main
          path: ./system-tests
          token: ${{ secrets.CICD_REPO_TOKEN }}

Yep trying this now

> I think all you need to do is add the `token` to the appropriate `actions/checkout` step: > > ``` > - name: "Clone system-tests" > uses: actions/checkout@v3 > with: > repository: cerc-io/system-tests > ref: main > path: ./system-tests > token: ${{ secrets.CICD_REPO_TOKEN }} > ``` Yep trying this now
Author
Member

Ah, this is because system-tests is a private repo (checking out cerc-io/plugeth and stack-orchestrator succeeds in the same job, which threw me off).

Ah, this is because `system-tests` is a private repo (checking out `cerc-io/plugeth` and stack-orchestrator succeeds in the same job, which threw me off).
Author
Member

Fixed in #10

Fixed in #10
roysc closed this issue 2023-09-28 00:04:39 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/plugeth-statediff#9
No description provided.