Skip to content

Commit f6bcd2a

Browse files
committed
add secrets
1 parent 0b386da commit f6bcd2a

File tree

2 files changed

+10
-21
lines changed

2 files changed

+10
-21
lines changed

.github/tools/detect-deps/main.go

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// Package main provides a tool to detect and resolve JFrog module dependencies
2-
// by parsing go.mod using `go mod edit -json` and checking for branch availability
3-
// in forked repositories.
41
package main
52

63
import (
@@ -45,17 +42,17 @@ type ModuleVersion struct {
4542

4643
// DependencyInfo holds information about a detected dependency
4744
type DependencyInfo struct {
48-
Name string // Short name like "build-info-go"
49-
ModulePath string // Full module path like "github.com/jfrog/build-info-go"
50-
Repo string // Repository like "jfrog/build-info-go"
51-
Ref string // Branch or tag reference
45+
Name string
46+
ModulePath string
47+
Repo string
48+
Ref string
5249
}
5350

5451
// jfrogDependencies maps short names to their module paths
5552
var jfrogDependencies = map[string]string{
56-
"build-info-go": "github.com/jfrog/build-info-go",
57-
"jfrog-client-go": "github.com/jfrog/jfrog-client-go",
58-
"jfrog-cli-core": "github.com/jfrog/jfrog-cli-core/v2",
53+
"build-info-go": "github.com/jfrog/build-info-go",
54+
"jfrog-client-go": "github.com/jfrog/jfrog-client-go",
55+
"jfrog-cli-core": "github.com/jfrog/jfrog-cli-core/v2",
5956
}
6057

6158
func main() {
@@ -91,11 +88,6 @@ func main() {
9188
defer output.Close()
9289
}
9390

94-
fmt.Println("============================================")
95-
fmt.Println("Detecting JFrog dependencies...")
96-
fmt.Println("============================================")
97-
fmt.Printf("Current branch: %s\n\n", currentBranch)
98-
9991
// Process each dependency
10092
for name, modulePath := range jfrogDependencies {
10193
info := detectDependency(name, modulePath, replaces, currentBranch)
@@ -162,15 +154,14 @@ func detectDependency(name, modulePath string, replaces map[string]Replace, curr
162154
}
163155
}
164156

165-
// Fall back to master
166157
fmt.Printf("No matching branch for %s, will use default (master)\n", name)
167158
return nil
168159
}
169160

170161
// branchExists checks if a branch exists in a GitHub repository
171162
func branchExists(repo, branch string) bool {
172163
if branch == "" || branch == "main" || branch == "master" {
173-
return false // Don't try to match main/master, use defaults
164+
return false
174165
}
175166

176167
url := fmt.Sprintf("https://github.com/%s.git", repo)
@@ -180,7 +171,6 @@ func branchExists(repo, branch string) bool {
180171
return false
181172
}
182173

183-
// If output contains the branch name, it exists
184174
return strings.Contains(string(out), fmt.Sprintf("refs/heads/%s", branch))
185175
}
186176

@@ -201,7 +191,6 @@ func writeOutput(output *os.File, name string, info *DependencyInfo) {
201191
fmt.Fprintf(output, "%s_ref=%s\n", keyName, ref)
202192
}
203193

204-
// Also print for visibility
205194
if info != nil {
206195
fmt.Printf(" %s_repo=%s\n", keyName, repo)
207196
fmt.Printf(" %s_ref=%s\n", keyName, ref)

.github/workflows/cli-integration-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ jobs:
243243
244244
- name: Run Go tests
245245
working-directory: jfrog-cli
246-
run: go test -v -timeout 0 --test.go --jfrog.url=${{ secrets.PLATFORM_URL }} --jfrog.adminToken=${{ secrets.PLATFORM_ADMIN_TOKEN }} --ci.runId=${{ runner.os }}-go
246+
run: go test -v -timeout 0 --test.go --jfrog.url=${{ secrets.EPLUS_PLATFORM_URL }} --jfrog.adminToken=${{ secrets.EPLUS_ADMIN_TOKEN }} --ci.runId=${{ runner.os }}-go
247247

248248
NuGet-Tests:
249249
name: NuGet ${{ matrix.os.name }}
@@ -1265,4 +1265,4 @@ jobs:
12651265
12661266
- name: Run Distribution tests
12671267
working-directory: jfrog-cli
1268-
run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.distribution --jfrog.url=${{ secrets.PLATFORM_URL }} --jfrog.adminToken=${{ secrets.PLATFORM_ADMIN_TOKEN }} --jfrog.user=${{ secrets.PLATFORM_USER }} --ci.runId=${{ runner.os }}-distribution
1268+
run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.distribution --jfrog.url=${{ secrets.EPLUS_PLATFORM_URL }} --jfrog.adminToken=${{ secrets.EPLUS_ADMIN_TOKEN }} --jfrog.user=${{ secrets.PLATFORM_USER }} --ci.runId=${{ runner.os }}-distribution

0 commit comments

Comments
 (0)