go-semantic-release / semantic-release

📦🚀 semantic-release written in Go
https://go-semantic-release.xyz
MIT License
404 stars 43 forks source link

How to configure the git provider #104

Closed avillalain closed 3 years ago

avillalain commented 3 years ago

Hi team,

I'm trying to configure go-semantic-release to use with a generic git repository and keep getting this error:

[go-semantic-release]: authentication required

I've tried setting up GIT_CREDENTIALS similar to the npm semantic release project, setting auth_username, auth_password and auth=basic based on the provider-git, but no luck. The last command I was executing is the following:

semantic-release --alow-initial-development-versions --changelog CHANGELOG.md \
    --changelog-generator-opt emojis=true --provider git --provider-opt auth=basic auth_username=<username> \
    auth_password=<password>
christophwitzko commented 3 years ago

Hi @avillalain,

thank you for using semantic-release. ☺️ I think you need for every provider option the --provider-opt flag:

--provider-opt auth=basic --provider-opt auth_username=<username> --provider-opt auth_password=<password>
avillalain commented 3 years ago

@christophwitzko I tried that, and it did not work either. I'm wondering if there is a better location to find documentation on how to configure this.

EDIT there was a typo... I need to get a new prescription for my glasses :)

christophwitzko commented 3 years ago

@avillalain I am sorry about the docs, this is still a big todo.

I just tried it on GitHub Actions and it works fine, here is the workflow:

name: CI
on:
  push:
    branches:
      - '**'
  pull_request:
    branches:
      - '**'

jobs:
  build:
      runs-on: ubuntu-latest
      steps:
        - uses: actions/checkout@v2
          with:
            fetch-depth: 0
        - run: curl -SL https://get-release.xyz/semantic-release/linux/amd64 -o ./semantic-release && chmod +x ./semantic-release
        - run: ./semantic-release --provider git --provider-opt auth=basic --provider-opt auth_password=${{ secrets.GITHUB_TOKEN }}

What git service are you using?