Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/reusable-build-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,23 @@ env:

jobs:

check-secrets:
runs-on: ubuntu-latest
steps:
- name: Check secrets are set
id: check
if: "${{ env.imagenamespace == '' }}"
run: |
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"
echo "missing=true">>$GITHUB_OUTPUT
outputs:
missing-secrets: ${{ steps.check.outputs.missing }}

build-operator:
needs: check-secrets
name: Build ${{ inputs.operator_name }}-operator image using buildah
runs-on: ubuntu-latest
if: needs.check-secrets.outputs.missing-secrets != 'true'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally it would just be a case of if: ${ env.imagenamespace != ''} but very little data is available in the scope of the job conditionals. It's mostly just the status of other jobs, so need to workaround this by using a helper job to check the secrets.

The side-effect is that the overall result is the action is success, not skipped, so I've added an error message to make it clearer that the action has issues


steps:
- uses: actions/checkout@v4
Expand Down
Loading