Skip to content

Commit d83c3a9

Browse files
authored
ci: update GHA to use env vars (#15981)
1 parent c9bdeeb commit d83c3a9

4 files changed

Lines changed: 21 additions & 10 deletions

File tree

.github/workflows/external-account-integration.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ jobs:
5656
working-directory: "${{runner.temp}}"
5757
run: |
5858
mkdir -p vcpkg
59-
curl -fsSL "https://github.com/microsoft/vcpkg/archive/${{ steps.vcpkg-version.outputs.version }}.tar.gz" |
59+
curl -fsSL "https://github.com/microsoft/vcpkg/archive/${STEPS_VCPKG_VERSION_OUTPUTS_VERSION}.tar.gz" |
6060
tar -C vcpkg --strip-components=1 -zxf -
6161
vcpkg/bootstrap-vcpkg.sh -disableMetrics
62+
env:
63+
STEPS_VCPKG_VERSION_OUTPUTS_VERSION: ${{ steps.vcpkg-version.outputs.version }}
6264
# First compile the code using the identity with access to the build cache
6365
- run: |
6466
env VCPKG_ROOT="${{ runner.temp }}/vcpkg" ci/gha/builds/external-account.sh

.github/workflows/test-runner.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ jobs:
3939
run: |
4040
echo "event=${{ github.event_name }}"
4141
echo "assoc=${{ github.event.pull_request.author_association }}"
42-
echo "org=${{ github.organization }}" || true
43-
echo "user=${{ github.event.pull_request.user }}" || true
44-
echo "user_orgs=${{ github.event.pull_request.user.organizations_url }}" || true
45-
42+
echo "org=${GITHUB_ORGANIZATION}" || true
43+
echo "user=${GITHUB_EVENT_PULL_REQUEST_USER}" || true
44+
echo "user_orgs=${GITHUB_EVENT_PULL_REQUEST_USER_ORGANIZATIONS_URL}" || true
45+
env:
46+
GITHUB_ORGANIZATION: ${{ github.organization }}
47+
GITHUB_EVENT_PULL_REQUEST_USER: ${{ github.event.pull_request.user }}
48+
GITHUB_EVENT_PULL_REQUEST_USER_ORGANIZATIONS_URL: ${{ github.event.pull_request.user.organizations_url }}
4649
pre-flight:
4750
# Save the `ref` of the pull request, so downstream jobs know what to checkout.
4851
environment: >-

.github/workflows/windows-bazel.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ jobs:
7070
# Using a short name like this avoids the problem in most cases.
7171
mkdir -p 'c:\b' || true
7272
export BAZEL_ROOT='c:\b'
73-
export BAZEL_REMOTE_CACHE_RW_MODE=${{ inputs.bazel-cache-mode }}
73+
export BAZEL_REMOTE_CACHE_RW_MODE=${INPUTS_BAZEL_CACHE_MODE}
7474
export EXECUTE_INTEGRATION_TESTS=${{ inputs.execute-integration-tests }}
7575
ci/gha/builds/windows-bazel.sh ${{ matrix.compilation_mode }} ${{ join(matrix.targets, ' ') }}
76+
env:
77+
INPUTS_BAZEL_CACHE_MODE: ${{ inputs.bazel-cache-mode }}
7678
- name: Post Build Disk Space
7779
shell: bash
7880
run: df -m

.github/workflows/windows-cmake.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,10 @@ jobs:
299299
run: |
300300
cd "${TEMP}"
301301
mkdir -p .build/vcpkg
302-
curl -fsSL "https://github.com/microsoft/vcpkg/archive/${{ steps.dynamic.outputs.vcpkg-version }}.tar.gz" |
303-
tar -C .build/vcpkg --strip-components=1 -zxf -
302+
curl -fsSL "https://github.com/microsoft/vcpkg/archive/${STEPS_DYNAMIC_OUTPUTS_VCPKG_VERSION}.tar.gz" | tar -C .build/vcpkg --strip-components=1 -zxf -
304303
.build/vcpkg/bootstrap-vcpkg.sh -disableMetrics
304+
env:
305+
STEPS_DYNAMIC_OUTPUTS_VCPKG_VERSION: ${{ steps.dynamic.outputs.vcpkg-version }}
305306
# go/github-actions#gha-bestpractices explains why we use a SHA instead of
306307
# a named version for this runner. We could avoid using this runner with the
307308
# ideas from:
@@ -315,12 +316,15 @@ jobs:
315316
shell: bash
316317
run: |
317318
export VCPKG_ROOT="${TEMP}/.build/vcpkg"
318-
export CLOUDSDK_PYTHON="${{ steps.py311.outputs.python-path }}"
319+
export CLOUDSDK_PYTHON="${STEPS_PY311_OUTPUTS_PYTHON_PATH}"
319320
# Put the CMake output in a directory with more space and keep it short
320321
# to avoid running into the MSVC limits.
321322
export CMAKE_OUT='c:\b'
322323
export EXECUTE_INTEGRATION_TESTS=${{ inputs.execute-integration-tests }}
323-
ci/gha/builds/windows-cmake.sh ${{ matrix.build_type }} ${{ steps.dynamic.outputs.features }}
324+
ci/gha/builds/windows-cmake.sh ${{ matrix.build_type }} ${STEPS_DYNAMIC_OUTPUTS_FEATURES}
325+
env:
326+
STEPS_PY311_OUTPUTS_PYTHON_PATH: ${{ steps.py311.outputs.python-path }}
327+
STEPS_DYNAMIC_OUTPUTS_FEATURES: ${{ steps.dynamic.outputs.features }}
324328
- name: Post Build Disk Space
325329
shell: bash
326330
run: df -m

0 commit comments

Comments
 (0)