Skip to content

Commit 053dc5c

Browse files
authored
Add workflow secret inputs (#542)
Signed-off-by: Jose R. Gonzalez <[email protected]>
1 parent 35153ad commit 053dc5c

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

.github/workflows/functional-tests.yaml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ on:
3535
3636
For security, this checkout-ref should generally be a commit hash
3737
for untrusted content.
38+
secrets:
39+
# TODO: Refactor cluster-api-server as it's not actually a secret but must
40+
# be because it's listed in-repo as a secret.
41+
cluster-api-server:
42+
required: true
43+
description: |
44+
Base64 encoded API server URL for the cluster. Not technically a secret.
45+
46+
cluster-token:
47+
required: true
48+
description: Token for authenticating with the cluster
3849
jobs:
3950
run-functional-tests:
4051
runs-on: ubuntu-latest
@@ -113,17 +124,19 @@ jobs:
113124
env:
114125
KUBECONFIG: /tmp/ci-kubeconfig
115126
EVENT_NUMBER: ${{ inputs.event-identifier }}
127+
CLUSTER_API_SERVER: ${{ secrets.cluster-api-server }}
128+
CLUSTER_TOKEN: ${{ secrets.cluster-token }}
116129
run: |
117130
# oc login
118-
API_SERVER=$( echo -n ${{ secrets.API_SERVER }} | base64 -d)
131+
API_SERVER=$( echo -n "${CLUSTER_API_SERVER}" | base64 -d)
119132
gpg --version
120133
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
121134
if [ $GITHUB_REPOSITORY == "redhat-certification/chart-verifier" ]; then
122135
# TODO: temporarily allow for skipping TLS verification as the new cluster uses local-only certificates
123136
# This if logic isn't removed to remind us to come back and swap this out when a valid cert is put in place.
124-
oc login --insecure-skip-tls-verify --token="${{ secrets.CLUSTER_TOKEN }}" --server="${API_SERVER}"
137+
oc login --insecure-skip-tls-verify --token="${CLUSTER_TOKEN}" --server="${API_SERVER}"
125138
else
126-
oc login --insecure-skip-tls-verify --token="${{ secrets.CLUSTER_TOKEN }}" --server="${API_SERVER}"
139+
oc login --insecure-skip-tls-verify --token="${CLUSTER_TOKEN}" --server="${API_SERVER}"
127140
fi
128141
ve1/bin/sa-for-chart-testing --create "charts-${EVENT_NUMBER}" --token token.txt --server "${API_SERVER}"
129142
@@ -142,8 +155,10 @@ jobs:
142155
env:
143156
KUBECONFIG: /tmp/ci-kubeconfig
144157
EVENT_NUMBER: ${{ inputs.event-identifier }}
158+
CLUSTER_API_SERVER: ${{ secrets.cluster-api-server }}
159+
CLUSTER_TOKEN: ${{ secrets.cluster-token }}
145160
run: |
146161
# delete the namespace
147-
API_SERVER=$( echo -n ${{ secrets.API_SERVER }} | base64 -d)
148-
oc login --token="${{ secrets.CLUSTER_TOKEN }}" --server="${API_SERVER}"
162+
API_SERVER=$( echo -n "${CLUSTER_API_SERVER}" | base64 -d)
163+
oc login --token="${CLUSTER_TOKEN}" --server="${API_SERVER}"
149164
ve1/bin/sa-for-chart-testing --delete "charts-${EVENT_NUMBER}"

.github/workflows/pr-functional-tests.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ jobs:
8484
checkout-repository: ${{ needs.check-ok-to-test.outputs.target-repo }}
8585
checkout-ref: ${{ needs.check-ok-to-test.outputs.target-sha }}
8686
event-identifier: ${{ github.event.pull_request.number }}
87-
87+
secrets:
88+
cluster-api-server: ${{ secrets.API_SERVER }}
89+
cluster-token: ${{ secrets.CLUSTER_TOKEN }}
8890

8991
handle-release-pr:
9092
name: Validate Release Intent

0 commit comments

Comments
 (0)