sbt-dependency-submission icon indicating copy to clipboard operation
sbt-dependency-submission copied to clipboard

fatal: could not read Username for 'https://github.com': No such file or directory

Open felickz opened this issue 3 years ago • 2 comments

For dependencies that reference a private repo via plugin (example here)..

Is the token input intended to resolve this error or will a git config need to be added to specify a token for each repo?

felickz avatar Nov 17 '22 20:11 felickz

Thanks for opening this issue!

It is likely indeed that sbt cannot use the token input to resolve private git repositories. But I would like to make it work.

Does anyone know how to solve this?

adpi2 avatar Nov 18 '22 08:11 adpi2

Hi @adpi2 & @felickz!

To solve this issue you must add the following step which is needed to for git clone to work in this scenario.

steps:
      - name: Configure git
        env:
          TOKEN: ${{ secrets.PAT }}
        run: git config --global url."https://${TOKEN}:[[email protected]](mailto:[email protected])/".insteadOf "https://github.com/"
name: Scala Dependency Graph Generation for Dependabot
 
on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]
 
jobs:
  dependency-graph:
    name: Update Dependency Graph
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: write
      security-events: write
    steps:
      - name: Configure git
        env:
          TOKEN: ${{ secrets.PAT }}
        run: git config --global url."https://${TOKEN}:[[email protected]](mailto:[email protected])/".insteadOf "https://github.com/"
      - uses: actions/checkout@v3
      - uses: scalacenter/[email protected]
        with:
          token: ${{ secrets.PAT }}

jackgkafaty avatar Nov 22 '22 15:11 jackgkafaty