Skip to content

Commit 824fa1e

Browse files
committed
fix: use dog fooding instance in tests
1 parent d4c0eb5 commit 824fa1e

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

.github/workflows/test-action.yml

+22-9
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,39 @@ on:
99

1010
jobs:
1111
test-install:
12+
permissions:
13+
# Needed for stackrox/central-login to create the JWT token.
14+
id-token: write
1215
strategy:
16+
fail-fast: false
1317
matrix:
1418
os: [ubuntu-latest, windows-latest, macos-latest]
1519
version: [latest, 4.3.0]
16-
central-endpoint:
17-
[
18-
"",
19-
"https://staging.demo.stackrox.com",
20-
"staging.demo.stackrox.com:443"
21-
]
20+
central-endpoint: ["empty", "https-prefix", "no-prefix"]
2221
runs-on: ${{ matrix.os }}
2322
steps:
2423
- uses: actions/checkout@v4
24+
- name: Central login
25+
uses: stackrox/central-login@v1
26+
with:
27+
endpoint: ${{ vars.ACS_DOGFOODING_CENTRAL_URL }}
28+
- name: Set CENTRAL_ENDPOINT env variable
29+
shell: bash
30+
run: |
31+
if [[ "${{ matrix.central-endpoint }}" == "https-prefix" ]]; then
32+
CENTRAL_ENDPOINT="${{ vars.ACS_DOGFOODING_CENTRAL_URL }}"
33+
elif [[ "${{ matrix.central-endpoint }}" == "no-prefix" ]]; then
34+
# Strip "https://" prefix and add ":443" suffix.
35+
CENTRAL_ENDPOINT="${${{ vars.ACS_DOGFOODING_CENTRAL_URL }}#https://}:443"
36+
fi
37+
echo "$CENTRAL_ENDPOINT"
38+
echo "CENTRAL_ENDPOINT=${CENTRAL_ENDPOINT}" >> "$GITHUB_ENV"
2539
- name: Install roxctl
2640
uses: ./
2741
with:
2842
roxctl-release: ${{ matrix.version }}
29-
central-endpoint: ${{ matrix.central-endpoint }}
30-
central-token: ${{ secrets.STAGING_API_TOKEN }}
31-
43+
central-endpoint: ${{ env.CENTRAL_ENDPOINT }}
44+
central-token: ${{ env.ROX_API_TOKEN }}
3245
- name: Validate the roxctl install
3346
shell: bash
3447
run: roxctl version

0 commit comments

Comments
 (0)