Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build): go build allow private repo access #108

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/go-build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ jobs:
with:
# Allow goreleaser to access older tag information.
fetch-depth: 0

- name: Set up private repo access for go get
run: |
git config --global url."https://$GITHUB_TOKEN:[email protected]/".insteadOf "https://github.com/"
env:
GITHUB_TOKEN: ${{ secrets.V2BUILDTOKEN}}

- uses: keyfactor/[email protected]
with:
go-version-file: 'go.mod'
Expand All @@ -52,7 +59,7 @@ jobs:
args: ${{ env.GO_ARGS }}
env:
# GitHub sets the GITHUB_TOKEN secret automatically.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.V2BUILDTOKEN}}
PAT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GPG_TTY: $(tty)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/starter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
call-go-build-and-release-workflow:
needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow,call-goreleaser-exists]
if: needs.call-get-primary-language.outputs.primary_language == 'Go' && needs.call-goreleaser-exists.outputs.goreleaser-exists == 'true'
uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@v3
uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@go_build_private_repo_access
with:
release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }}
secrets:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

# Changelog

## v3.1.3

### Fixes

- Configure `go` build process to use build token for private repository access.
Loading