Skip to content

Commit 4efb3df

Browse files
committed
CI: tweak OCI build triggers
Building on push to any branch is wasteful and unnecessary, because most of built images are never used. The workflow dispatch trigger covers the use case to build an image from the latest commit in a branch. The use case to validate/QA a PR is now covered by on pull request trigger. This trigger has a caveat: PRs from forks won't produce a docker image. Why? Because PRs from forks do not inject rabbitmq-server secrets. This is a security mechanism from GitHub, to protect repository secrets. With this trigger is possible to QA/validate PRs from other Core team members. Technically, anyone with 'write' access to our repo to push branches.
1 parent 3e1fa7b commit 4efb3df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/oci-make.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
name: OCI (make)
77
on:
8-
push:
8+
pull_request:
99
paths:
1010
- deps/**
1111
- scripts/**
@@ -27,7 +27,7 @@ on:
2727
default: false
2828
env:
2929
REGISTRY_IMAGE: pivotalrabbitmq/rabbitmq
30-
VERSION: 4.1.0+${{ github.sha }}
30+
VERSION: 4.2.0+${{ github.sha }}
3131
concurrency:
3232
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
3333
cancel-in-progress: true
@@ -39,6 +39,8 @@ jobs:
3939
- ${{ github.event.inputs.otp_version || '27' }}
4040
runs-on: ubuntu-latest
4141
outputs:
42+
# When dependabot, or a user from a fork, creates PRs, secrets are not injected, and the OCI workflow can't push the image
43+
# This check acts as a gate keeper
4244
authorized: ${{ steps.authorized.outputs.authorized }}
4345
steps:
4446
- name: CHECK IF IMAGE WILL PUSH

0 commit comments

Comments
 (0)