|
1 | 1 | name: OIDC Integration Test |
| 2 | +# This workflow tests the setup-jfrog-cli GitHub Action's OpenID Connect integration across OSes and CLI versions. |
| 3 | +# It ensures backward compatibility with older CLI versions and validates step outputs and connectivity. |
| 4 | +# CLI versions used: |
| 5 | +# - 2.74.1: Does not support `jf eot` command, validates manual fallback logic. |
| 6 | +# - 2.75.0: Introduced native OIDC token exchange. |
| 7 | +# - Latest: Ensures ongoing compatibility with the most recent CLI build. |
2 | 8 |
|
3 | 9 | on: |
4 | 10 | push: |
5 | 11 | branches: |
6 | | - - '**' |
7 | | - |
| 12 | + - master |
| 13 | + # Triggers the workflow on labeled PRs only. |
| 14 | + pull_request_target: |
| 15 | + types: [ labeled ] |
| 16 | +# Ensures that only the latest commit is running for each PR at a time. |
8 | 17 | concurrency: |
9 | 18 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.ref }} |
10 | 19 | cancel-in-progress: true |
|
18 | 27 | strategy: |
19 | 28 | fail-fast: true |
20 | 29 | matrix: |
21 | | - os: [ubuntu, macos, windows] |
22 | | - cli-version: ['2.74.1', '2.75.0'] |
| 30 | + os: [ ubuntu, macos, windows ] |
| 31 | + cli-version: [ '2.74.1', '2.75.0','latest' ] |
23 | 32 | runs-on: ${{ matrix.os }}-latest |
24 | 33 | name: OIDC Test - ${{ matrix.cli-version }} on ${{ matrix.os }} |
25 | 34 | env: |
|
31 | 40 | with: |
32 | 41 | ref: ${{ github.event.pull_request.head.sha }} |
33 | 42 |
|
| 43 | + # Setup OIDC platform integration |
34 | 44 | - name: Generate unique OIDC provider name |
35 | 45 | id: gen-oidc |
36 | 46 | shell: bash |
|
70 | 80 | } |
71 | 81 | }' |
72 | 82 |
|
| 83 | + # Setup |
73 | 84 | - name: Setup JFrog CLI |
74 | 85 | id: setup-jfrog-cli |
75 | 86 | uses: ./ |
|
79 | 90 | version: ${{ matrix.cli-version }} |
80 | 91 | oidc-provider-name: ${{ steps.gen-oidc.outputs.oidc_provider_name }} |
81 | 92 |
|
| 93 | + # validate successful OIDC configuration |
82 | 94 | - name: Test JFrog CLI connectivity |
83 | 95 | run: jf rt ping |
84 | 96 |
|
| 97 | + # Validate step outputs |
85 | 98 | - name: Validate user output |
86 | 99 | shell: bash |
87 | 100 | run: test -n "${{ steps.setup-jfrog-cli.outputs.oidc-user }}" |
|
90 | 103 | shell: bash |
91 | 104 | run: test -n "${{ steps.setup-jfrog-cli.outputs.oidc-token }}" |
92 | 105 |
|
| 106 | + # Cleanup |
93 | 107 | - name: Delete OIDC integration |
94 | 108 | shell: bash |
95 | 109 | if: always() |
|
0 commit comments