Skip to content

Commit 65298e5

Browse files
committed
Cleanup conditionals
1 parent bacbcc4 commit 65298e5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
- run: pip-licenses
4141

4242
operator-image-buildable:
43+
env:
44+
USE_ELASTIC_REGISTRY: ${{ github.event_name != 'pull_request' || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]' ) }}
4345
runs-on: ubuntu-latest
4446
steps:
4547
- uses: actions/checkout@v4
@@ -54,11 +56,11 @@ jobs:
5456
registry: ${{ secrets.ELASTIC_DOCKER_REGISTRY }}
5557
username: ${{ secrets.ELASTIC_DOCKER_USERNAME }}
5658
password: ${{ secrets.ELASTIC_DOCKER_PASSWORD }}
57-
if: github.event_name != 'pull_request' || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]' )
59+
if: ${{ env.USE_ELASTIC_REGISTRY }}
5860
- run: docker build -f operator/Dockerfile --build-arg DISTRO_DIR=./dist .
59-
if: github.event_name != 'pull_request' || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]' )
61+
if: ${{ env.USE_ELASTIC_REGISTRY }}
6062
- run: docker build -f operator/Dockerfile --build-arg PYTHON_GLIBC_IMAGE=cgr.dev/chainguard/python --build-arg PYTHON_GLIBC_IMAGE_VERSION=latest --build-arg DISTRO_DIR=./dist --build-arg IMAGE=cgr.dev/chainguard/busybox --build-arg IMAGE_VERSION=latest .
61-
if: github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork == true || github.actor == 'dependabot[bot]')
63+
if: ${{ ! env.USE_ELASTIC_REGISTRY }}
6264

6365
test:
6466
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)