From 3b1f5e30877bc7541a80948b2134a01aced20485 Mon Sep 17 00:00:00 2001 From: Matt Keeler Date: Wed, 29 Jan 2025 17:37:10 -0500 Subject: [PATCH] Sync with Ent --- .github/workflows/build-distros.yml | 2 +- .github/workflows/build.yml | 8 ++++++++ .github/workflows/goldenfile-checker.yml | 2 +- .github/workflows/reusable-unit-split.yml | 4 ++++ .github/workflows/reusable-unit.yml | 2 +- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-distros.yml b/.github/workflows/build-distros.yml index cd05c32885b5..a974c390c0d0 100644 --- a/.github/workflows/build-distros.yml +++ b/.github/workflows/build-distros.yml @@ -14,7 +14,7 @@ permissions: contents: read env: - GOTAGS: hashicorpmetrics ${{ endsWith(github.repository, '-enterprise') && 'consulent' || '' }} + GOTAGS: ${{ endsWith(github.repository, '-enterprise') && 'consulent,hashicorpmetrics' || 'hashicorpmetrics' }} GOPRIVATE: github.com/hashicorp # Required for enterprise deps concurrency: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0822bc58df71..a892ee36e783 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -107,6 +107,10 @@ jobs: name: Go ${{ needs.get-go-version.outputs.go-version }} ${{ matrix.goos }} ${{ matrix.goarch }} build steps: - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + - name: Setup Git + if: ${{ endsWith(github.repository, '-enterprise') }} + run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com" - name: Setup with node and yarn uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 @@ -209,6 +213,10 @@ jobs: name: Go ${{ needs.get-go-version.outputs.go-version }} ${{ matrix.goos }} ${{ matrix.goarch }} build steps: - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + # NOTE: This step is specifically needed for ENT. It allows us to access the required private HashiCorp repos. + - name: Setup Git + run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com" - name: Setup with node and yarn uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 diff --git a/.github/workflows/goldenfile-checker.yml b/.github/workflows/goldenfile-checker.yml index 4551350ad3c0..493ab2f2eea3 100644 --- a/.github/workflows/goldenfile-checker.yml +++ b/.github/workflows/goldenfile-checker.yml @@ -15,7 +15,7 @@ on: - release/* env: - GOFLAGS: -tags=hashicorpmetrics + GOFLAGS: -tags=${{ endsWith(github.repository, '-enterprise') && 'hashicorpmetrics,consulent' || 'hashicorpmetrics' }} jobs: get-go-version: diff --git a/.github/workflows/reusable-unit-split.yml b/.github/workflows/reusable-unit-split.yml index 68923021e722..e4123d4cb3a2 100644 --- a/.github/workflows/reusable-unit-split.yml +++ b/.github/workflows/reusable-unit-split.yml @@ -68,6 +68,10 @@ jobs: - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: go-version: ${{ inputs.go-version }} + # Needed only for enterprise + - name: Setup Git + if: ${{ endsWith(inputs.repository-name, '-enterprise') }} + run: git config --global url."https://${{ secrets.elevated-github-token }}:@github.com".insteadOf "https://github.com" - id: set-matrix run: ./.github/scripts/set_test_package_matrix.sh ${{env.TOTAL_RUNNERS}} diff --git a/.github/workflows/reusable-unit.yml b/.github/workflows/reusable-unit.yml index f98b4610ee44..fe2cf0224ce3 100644 --- a/.github/workflows/reusable-unit.yml +++ b/.github/workflows/reusable-unit.yml @@ -48,7 +48,7 @@ env: GOTESTSUM_VERSION: "1.11.0" GOARCH: ${{inputs.go-arch}} CONSUL_LICENSE: ${{secrets.consul-license}} - GOTAGS: hashicorpmetrics ${{ inputs.go-tags}} + GOTAGS: hashicorpmetrics,${{ inputs.go-tags}} GOPRIVATE: github.com/hashicorp # Required for enterprise deps DATADOG_API_KEY: ${{secrets.datadog-api-key}}