Skip to content

Commit

Permalink
ci(release): debug with GITHUB_TOKEN (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrqr authored Oct 21, 2021
1 parent ed7bf77 commit 7567875
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ jobs:
run: |
git config --global user.name "${{ secrets.CB_RELEASE_BOT_NAME }}"
git config --global user.email "${{ secrets.CB_RELEASE_BOT_EMAIL }}"
git config --local --replace-all url.https://github.com/.insteadOf ssh://git@github.com/
git config --local --add url.https://git:${{ steps.release-bot.outputs.token }}@github.com/.insteadOf git@github.com:
# git config --local --replace-all url.https://github.com/.insteadOf ssh://git@github.com/
# git config --local --add url.https://git:${{ steps.release-bot.outputs.token }}@github.com/.insteadOf git@github.com:
# debugging purposes
cat .git/config
- name: Bump Version
run: git semver bump
env:
GITHUB_TOKEN: ${{ steps.release-bot.outputs.token }}

- name: GoReleaser
uses: goreleaser/goreleaser-action@v2
Expand Down
5 changes: 5 additions & 0 deletions internal/git/mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
"github.com/go-git/go-git/v5/plumbing/storer"
"github.com/go-git/go-git/v5/plumbing/transport/http"
)

type Commit = object.Commit
Expand Down Expand Up @@ -134,6 +135,10 @@ func PushTagsToOrigin(repo *Repository) error {
RemoteName: "origin",
Progress: os.Stdout,
RefSpecs: []config.RefSpec{config.RefSpec("refs/tags/*:refs/tags/*")},
Auth: &http.BasicAuth{
Username: "git",
Password: os.Getenv("GITHUB_TOKEN"),
},
}

if err := repo.Push(pushOpts); err != nil {
Expand Down

0 comments on commit 7567875

Please sign in to comment.