@@ -133,7 +133,7 @@ jobs:
133133 - name : Cache Git
134134 id : cache-git
135135 if : (matrix.package == 'rpm' || matrix.image == 'debian:10') && matrix.image != ''
136- uses : actions/cache@v4
136+ uses : actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3, DO NOT BUMP, v4 BREAKS ON CENTOS7 OR AMAZONLINUX2
137137 with :
138138 path : /usr/local/git
139139 key : ${{ matrix.label }}-git-2.41.0
@@ -194,7 +194,7 @@ jobs:
194194 - name : Cache Packages
195195 id : cache-deps
196196 if : env.GHA_CACHE == 'true'
197- uses : actions/cache@v4
197+ uses : actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3, DO NOT BUMP, v4 BREAKS ON CENTOS7 OR AMAZONLINUX2
198198 with :
199199 path : bazel-bin/pkg
200200 key : ${{ steps.cache-key.outputs.cache-key }}
@@ -204,7 +204,7 @@ jobs:
204204 grep -v '^#' .requirements >> $GITHUB_ENV
205205
206206 - name : Setup Bazel
207- uses : bazelbuild/setup-bazelisk@b39c379c82683a5f25d34f0d062761f62693e0b2 # v3 .0.0
207+ uses : bazelbuild/setup-bazelisk@95c9bf48d0c570bb3e28e57108f3450cd67c1a44 # v2 .0.0
208208
209209 - name : Install Deb Dependencies
210210 if : matrix.package == 'deb' && steps.cache-deps.outputs.cache-hit != 'true'
@@ -597,14 +597,20 @@ jobs:
597597 username : ${{ secrets.GHA_DOCKERHUB_PUSH_USER }}
598598 password : ${{ secrets.GHA_KONG_ORG_DOCKERHUB_PUSH_TOKEN }}
599599
600+ - uses : actions/checkout@v3
601+
602+ - name : Get latest commit SHA on master
603+ run : |
604+ echo "latest_sha=$(git ls-remote origin -h refs/heads/${{ github.event.inputs.default_branch }} | cut -f1)" >> $GITHUB_ENV
605+
600606 - name : Docker meta
601607 id : meta
602608 uses : docker/metadata-action@v5
603609 with :
604610 images : ${{ needs.metadata.outputs.docker-repository }}
605611 sep-tags : " "
606612 tags : |
607- type=raw,value=latest,enable=${{ matrix.label == 'ubuntu' }}
613+ type=raw,value=latest,enable=${{ matrix.label == 'ubuntu' && github.ref_name == github.event.inputs.default_branch && env.latest_sha == github.event.pull_request.head.sha }}
608614 type=match,enable=${{ github.event_name == 'workflow_dispatch' }},pattern=\d.\d,value=${{ github.event.inputs.version }}
609615 type=match,enable=${{ github.event_name == 'workflow_dispatch' && matrix.label == 'ubuntu' }},pattern=\d.\d,value=${{ github.event.inputs.version }},suffix=
610616 type=raw,enable=${{ github.event_name == 'workflow_dispatch' }},${{ github.event.inputs.version }}
0 commit comments