Skip to content

Commit

Permalink
add required github config (#1113)
Browse files Browse the repository at this point in the history
* add required github config

* set no username in git cfg

* use different syntax on windows
  • Loading branch information
burmudar authored Oct 2, 2024
1 parent f51f817 commit 554b805
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/go-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: (Windows) Enable pulling Go modules from private sourcegraph/sourcegraph
if: runner.os == 'Windows'
run: git config --global url."https://$env:PRIVATE_TOKEN@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
- name: (Default) Enable pulling Go modules from private sourcegraph/sourcegraph
if: runner.os != 'Windows'
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
- run: |
go test -race -v ./...
go test -v ./...
2 changes: 2 additions & 0 deletions .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: 1.22.5
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
- run: ./dev/go-lint.sh
2 changes: 2 additions & 0 deletions .github/workflows/goreleaser-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: 1.22.5
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
- name: Check GoReleaser config
uses: goreleaser/goreleaser-action@v5
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: 1.22.5
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
- run: go test ./...
- run: go test -race -v ./...
- run: echo "${DOCKER_PASSWORD}" | docker login -u=$DOCKER_USERNAME --password-stdin
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/scip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
chmod +x /usr/local/bin/src
- name: Set directory to safe for git
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
- name: Generate SCIP data
run: scip-go

Expand Down

0 comments on commit 554b805

Please sign in to comment.