Skip to content

Commit 7c99072

Browse files
committed
attempt to fix failing OC install in reusable workflow
1 parent 0409518 commit 7c99072

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

.github/workflows/oc-build-image.yaml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,32 @@ on:
1212
required: true
1313
openshift_licenseplate:
1414
required: true
15+
workflow_dispatch: # Allows manual triggering of the workflow
16+
inputs:
17+
image:
18+
description: 'Image name to build'
19+
required: true
20+
type: string
1521
permissions:
1622
contents: read # Needed for any potential checkout operations
1723
id-token: write # Needed for OIDC authentication with OpenShift
1824
defaults:
1925
run:
2026
working-directory: ./
2127
jobs:
22-
install:
28+
build-image:
2329
if: github.repository_owner == 'bcgov'
2430
runs-on: ubuntu-latest
2531
steps:
2632
- name: Install oc # Install OpenShift CLI, which is required for building images. It is not included in the default GitHub Actions runner.
2733
uses: redhat-actions/openshift-tools-installer@v1
2834
with:
29-
oc: latest
35+
oc: "4"
36+
37+
- name: Verify oc installation
38+
run: |
39+
which oc
40+
oc version --client
3041
3142
- name: Authenticate and set context
3243
uses: redhat-actions/oc-login@v1
@@ -37,4 +48,13 @@ jobs:
3748

3849
- name: Image build
3950
run: |
51+
echo "Starting build for image: ${{ inputs.image }}"
4052
oc start-build ${{ inputs.image }} --follow
53+
54+
# Verify the build completed successfully
55+
if [ $? -eq 0 ]; then
56+
echo "✅ Build completed successfully"
57+
else
58+
echo "❌ Build failed"
59+
exit 1
60+
fi

0 commit comments

Comments
 (0)