|
9 | 9 |
|
10 | 10 | jobs:
|
11 | 11 | test-install:
|
| 12 | + permissions: |
| 13 | + # Needed for stackrox/central-login to create the JWT token. |
| 14 | + id-token: write |
12 | 15 | strategy:
|
| 16 | + fail-fast: false |
13 | 17 | matrix:
|
14 | 18 | os: [ubuntu-latest, windows-latest, macos-latest]
|
15 | 19 | 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"] |
22 | 21 | runs-on: ${{ matrix.os }}
|
23 | 22 | steps:
|
24 | 23 | - 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" |
25 | 39 | - name: Install roxctl
|
26 | 40 | uses: ./
|
27 | 41 | with:
|
28 | 42 | 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 }} |
32 | 45 | - name: Validate the roxctl install
|
33 | 46 | shell: bash
|
34 | 47 | run: roxctl version
|
0 commit comments