setup-clojure icon indicating copy to clipboard operation
setup-clojure copied to clipboard

"Bad Credentials" fetching clj-kondo

Open rome-user opened this issue 2 years ago • 6 comments

I am trying to run the following workflow on Gitea/Forgejo actions.

name: clj-kondo checks
on: [push]
jobs:
  self-lint:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v3

    - name: Set up clj-kondo
      uses: https://github.com/DeLaGuardo/setup-clojure@master
      with:
        clj-kondo: latest

    - name: Run clj-kondo
      run: clj-kondo --lint src

This steps exactly at the "Set up clj-kondo" step with the following logs

[clj-kondo checks/self-lint] [DEBUG] executing remote job container: [node /var/run/act/actions/https---github.com-DeLaGuardo-setup-clojure@master/dist/index.js]
[clj-kondo checks/self-lint]   🐳  docker exec cmd=[node /var/run/act/actions/https---github.com-DeLaGuardo-setup-clojure@master/dist/index.js] user= workdir=
[clj-kondo checks/self-lint] [DEBUG] Exec command '[node /var/run/act/actions/https---github.com-DeLaGuardo-setup-clojure@master/dist/index.js]'
[clj-kondo checks/self-lint] [DEBUG] Working directory '/data/.cache/act/bunseki/backend-model'
[clj-kondo checks/self-lint]   ❗  ::error::Bad credentials
[clj-kondo checks/self-lint]   | ::error::Bad credentials
[clj-kondo checks/self-lint]   ❌  Failure - Main Set up clj-kondo
[clj-kondo checks/self-lint] exitcode '1': failure

rome-user avatar Jul 05 '23 09:07 rome-user

Hm… I know nothing about gitea actions. Exception doesn't look familiar as well.

DeLaGuardo avatar Jul 05 '23 10:07 DeLaGuardo

If it helps, it behaves similarly to running in https://github.com/nektos/act ... in fact the actions runner uses a fork of this. There is also a bug that happens where it 404s on fetching https://raw.githubusercontent.com/technomancy/leiningen/2.10.0/bin/lein yet I can access it just fine in the host, but not in the action runner for some reason.

rome-user avatar Jul 05 '23 10:07 rome-user

Thanks, that definitely should help. I will resolve this issue, but can't promise any particular time.

DeLaGuardo avatar Jul 05 '23 11:07 DeLaGuardo

So I noticed something similar when trying to use github actions to get babashka at my company's enterprise github. It seems like it won't work when grabbing latest because of the api.github.com call (https://github.com/DeLaGuardo/setup-clojure/blob/main/src/babashka.ts#L16). If I pinned the version, there's no need for the api call and the action ends up working for me.

Chowlz avatar Aug 07 '23 20:08 Chowlz

@Chowlz thanks for mentioning this. In regular (non enterprise) github this action uses GITHUB_TOKEN provided by github for each run to avoid hitting rate limits during api calls. Looks like this token is not defined for enterprise github. But at the same time, this is a bit different from the original problem with gitea. Please open another issue, overwise I'll open the one myself but later this week.

DeLaGuardo avatar Aug 09 '23 15:08 DeLaGuardo