diff --git a/.github/actions/checkout/action.yml b/.github/actions/checkout/action.yml index c92e4d71fd78..d43907f07c19 100644 --- a/.github/actions/checkout/action.yml +++ b/.github/actions/checkout/action.yml @@ -20,6 +20,8 @@ runs: uses: ./src/electron/.github/actions/install-dependencies - name: Install Build Tools uses: ./src/electron/.github/actions/install-build-tools + - name: Set Chromium Git Cookie + uses: ./src/electron/.github/actions/set-chromium-cookie - name: Get Depot Tools shell: bash run: | diff --git a/.github/actions/set-chromium-cookie/action.yml b/.github/actions/set-chromium-cookie/action.yml new file mode 100644 index 000000000000..5b41dd69224a --- /dev/null +++ b/.github/actions/set-chromium-cookie/action.yml @@ -0,0 +1,26 @@ +name: 'Set Chromium Git Cookie' +description: 'Sets an authenticated cookie from Chromium to allow for a higher request limit' +runs: + using: "composite" + steps: + - name: Set the git cookie from chromium.googlesource.com (Unix) + if: ${{ runner.os != 'Windows' }} + shell: bash + run: | + eval 'set +o history' 2>/dev/null || setopt HIST_IGNORE_SPACE 2>/dev/null + touch ~/.gitcookies + chmod 0600 ~/.gitcookies + + git config --global http.cookiefile ~/.gitcookies + + tr , \\t <<\__END__ >>~/.gitcookies + ${{ env.CHROMIUM_GIT_COOKIE }} + __END__ + eval 'set -o history' 2>/dev/null || unsetopt HIST_IGNORE_SPACE 2>/dev/null + - name: Set the git cookie from chromium.googlesource.com (Windows) + if: ${{ runner.os == 'Windows' }} + shell: cmd + run: | + git config --global http.cookiefile "%USERPROFILE%\.gitcookies" + powershell -noprofile -nologo -command Write-Output "${{ env.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}" >>"%USERPROFILE%\.gitcookies" + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bdfff61f5ebf..d540b5980b4d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,6 +100,7 @@ jobs: - /mnt/cross-instance-cache:/mnt/cross-instance-cache - /var/run/sas:/var/run/sas env: + CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }} GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac' outputs: build-image-sha: ${{ needs.setup.outputs.build-image-sha }} @@ -126,6 +127,7 @@ jobs: - /mnt/cross-instance-cache:/mnt/cross-instance-cache - /var/run/sas:/var/run/sas env: + CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }} GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' PATCH_UP_APP_CREDS: ${{ secrets.PATCH_UP_APP_CREDS }} outputs: @@ -150,6 +152,8 @@ jobs: volumes: - /mnt/cross-instance-cache:/mnt/cross-instance-cache env: + CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }} + CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }} GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True' TARGET_OS: 'win' ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN: '1' diff --git a/.github/workflows/pipeline-electron-lint.yml b/.github/workflows/pipeline-electron-lint.yml index 2124423e4b99..38dac828ca1e 100644 --- a/.github/workflows/pipeline-electron-lint.yml +++ b/.github/workflows/pipeline-electron-lint.yml @@ -27,6 +27,8 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} - name: Install Dependencies uses: ./src/electron/.github/actions/install-dependencies + - name: Set Chromium Git Cookie + uses: ./src/electron/.github/actions/set-chromium-cookie - name: Setup third_party Depot Tools shell: bash run: | diff --git a/.github/workflows/pipeline-segment-electron-build.yml b/.github/workflows/pipeline-segment-electron-build.yml index 6f99d7188a04..aa7e001ab7f2 100644 --- a/.github/workflows/pipeline-segment-electron-build.yml +++ b/.github/workflows/pipeline-segment-electron-build.yml @@ -65,6 +65,8 @@ concurrency: cancel-in-progress: ${{ github.ref_protected != true }} env: + CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }} + CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }} ELECTRON_ARTIFACTS_BLOB_STORAGE: ${{ secrets.ELECTRON_ARTIFACTS_BLOB_STORAGE }} ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }} SUDOWOODO_EXCHANGE_URL: ${{ secrets.SUDOWOODO_EXCHANGE_URL }} @@ -125,6 +127,8 @@ jobs: GN_EXTRA_ARGS='is_asan=true' fi echo "GN_EXTRA_ARGS=$GN_EXTRA_ARGS" >> $GITHUB_ENV + - name: Set Chromium Git Cookie + uses: ./src/electron/.github/actions/set-chromium-cookie - name: Get Depot Tools timeout-minutes: 5 run: | diff --git a/.github/workflows/pipeline-segment-electron-test.yml b/.github/workflows/pipeline-segment-electron-test.yml index ed5db9a04c9f..96f6833a230b 100644 --- a/.github/workflows/pipeline-segment-electron-test.yml +++ b/.github/workflows/pipeline-segment-electron-test.yml @@ -36,6 +36,8 @@ permissions: pull-requests: read env: + CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }} + CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }} ELECTRON_OUT_DIR: Default ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }} @@ -124,6 +126,8 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} - name: Install Dependencies uses: ./src/electron/.github/actions/install-dependencies + - name: Set Chromium Git Cookie + uses: ./src/electron/.github/actions/set-chromium-cookie - name: Get Depot Tools timeout-minutes: 5 run: | diff --git a/.github/workflows/pipeline-segment-node-nan-test.yml b/.github/workflows/pipeline-segment-node-nan-test.yml index 09b23cc6c8b8..0d44a2b77a56 100644 --- a/.github/workflows/pipeline-segment-node-nan-test.yml +++ b/.github/workflows/pipeline-segment-node-nan-test.yml @@ -57,6 +57,8 @@ jobs: e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }} - name: Install Dependencies uses: ./src/electron/.github/actions/install-dependencies + - name: Set Chromium Git Cookie + uses: ./src/electron/.github/actions/set-chromium-cookie - name: Get Depot Tools timeout-minutes: 5 run: | @@ -118,6 +120,8 @@ jobs: e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} - name: Install Dependencies uses: ./src/electron/.github/actions/install-dependencies + - name: Set Chromium Git Cookie + uses: ./src/electron/.github/actions/set-chromium-cookie - name: Get Depot Tools timeout-minutes: 5 run: |