Skip to content

Commit 04b91a8

Browse files
Merge pull request #117 from olliewalsh/nospam
[github-action] Skip build jobs and warn if secrets are not set
2 parents 7f1b92c + d42d409 commit 04b91a8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/reusable-build-operator.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,23 @@ env:
4646

4747
jobs:
4848

49+
check-secrets:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Check secrets are set
53+
id: check
54+
if: "${{ env.imagenamespace == '' }}"
55+
run: |
56+
echo "::error title=Missing required secrets::See https://github.com/openstack-k8s-operators/dev-docs/blob/main/image_build.md#creating-images-using-github-actions"
57+
echo "missing=true">>$GITHUB_OUTPUT
58+
outputs:
59+
missing-secrets: ${{ steps.check.outputs.missing }}
60+
4961
build-operator:
62+
needs: check-secrets
5063
name: Build ${{ inputs.operator_name }}-operator image using buildah
5164
runs-on: ubuntu-latest
65+
if: needs.check-secrets.outputs.missing-secrets != 'true'
5266

5367
steps:
5468
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)