mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-08 16:52:12 +08:00
fix: use GA_TRACKING_ID
This commit is contained in:
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -21,8 +21,6 @@ jobs:
|
|||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Release hrp cli binaries
|
- name: Release hrp cli binaries
|
||||||
uses: wangyoucao577/go-release-action@v1.22
|
uses: wangyoucao577/go-release-action@v1.22
|
||||||
env:
|
|
||||||
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
|
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
|
|||||||
2
.github/workflows/unittest.yml
vendored
2
.github/workflows/unittest.yml
vendored
@@ -27,8 +27,6 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Run coverage
|
- name: Run coverage
|
||||||
env:
|
|
||||||
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
|
|
||||||
run: go test -coverprofile="cover.out" -covermode=atomic -race ./...
|
run: go test -coverprofile="cover.out" -covermode=atomic -race ./...
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
uses: codecov/codecov-action@v2
|
uses: codecov/codecov-action@v2
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
package ga
|
package ga
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
|
|
||||||
"github.com/denisbrodbeck/machineid"
|
"github.com/denisbrodbeck/machineid"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
trackingID = "UA-114587036-1" // Tracking ID for Google Analytics
|
||||||
|
)
|
||||||
|
|
||||||
var gaClient *GAClient
|
var gaClient *GAClient
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
trackingID := os.Getenv("GA_TRACKING_ID") // Tracking ID for Google Analytics
|
|
||||||
clientID, err := machineid.ProtectedID("hrp")
|
clientID, err := machineid.ProtectedID("hrp")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
nodeUUID, _ := uuid.NewUUID()
|
nodeUUID, _ := uuid.NewUUID()
|
||||||
|
|||||||
Reference in New Issue
Block a user