Skip to content

Commit 2babdb0

Browse files
authored
Use the ref from env-protect-setup to get the docker image tag (#1483)
Summary: TSIA. This ensures that the `build-and-test` action runs on the new image when running on a PR that bumps the image. Type of change: /kind devinfra Test Plan: Check the github actions run on a PR that bumps the docker tag. Signed-off-by: Vihang Mehta <vihang@pixielabs.ai>
1 parent 332321f commit 2babdb0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.github/actions/env_protected_pr/action.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ runs:
3333
shell: bash
3434
run: |
3535
echo "" > env_name
36-
echo "${{ github.event.pull_request.head.sha }}" >> ref
37-
echo "${{ github.event.pull_request.head.sha }}" >> sha
36+
echo "${{ github.event.pull_request.head.sha }}" >> ref
37+
echo "${{ github.event.pull_request.head.sha }}" >> sha
3838
- name: Require external environment authorization.
3939
# yamllint disable rule:indentation
4040
if: >-
@@ -47,8 +47,8 @@ runs:
4747
shell: bash
4848
run: |
4949
echo "pr-actions-approval" > env_name
50-
echo "${{ github.event.pull_request.head.sha }}" >> ref
51-
echo "${{ github.event.pull_request.head.sha }}" >> sha
50+
echo "${{ github.event.pull_request.head.sha }}" >> ref
51+
echo "${{ github.event.pull_request.head.sha }}" >> sha
5252
- name: Set Output
5353
id: output
5454
shell: bash

.github/workflows/build_and_test.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ jobs:
3030
steps:
3131
- run: echo "Authorized"
3232
get-dev-image:
33-
needs: authorize
33+
needs: [authorize, env-protect-setup]
3434
uses: ./.github/workflows/get_image.yaml
3535
with:
3636
image-base-name: "dev_image_with_extras"
37+
ref: ${{ needs.env-protect-setup.outputs.ref }}
3738
clang-tidy:
3839
runs-on: ubuntu-latest-16-cores
3940
needs: [authorize, env-protect-setup, get-dev-image]

0 commit comments

Comments
 (0)