DeLaGuardo / setup-clojure

GitHub Action to provision clojure's most popular build tools for Linux, Mac OS X and Windows.
MIT License
183 stars 27 forks source link

"Bad Credentials" fetching clj-kondo #87

Open rome-user opened 1 year ago

rome-user commented 1 year ago

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
DeLaGuardo commented 1 year ago

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

rome-user commented 1 year ago

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.

DeLaGuardo commented 1 year ago

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

Chowlz commented 1 year ago

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.

DeLaGuardo commented 1 year ago

@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.