File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ # .github/workflows/test-oidc-get.yml
2+ name : Test OIDC GET Request
3+
4+ on :
5+ push :
6+ branches :
7+ - main
8+
9+ permissions :
10+ id-token : write # enable OIDC token issuance
11+ contents : read # allows checkout (not strictly needed here)
12+
13+ jobs :
14+ oidc-get :
15+ runs-on : ubuntu-latest
16+ env :
17+ CLIENT_ID : ${{ secrets.AZURE_CLIENT_ID }}
18+ API_URL : https://sentintel-content-dev-fue4ashcg9fnfge9.canadacentral-01.azurewebsites.net/ # π replace with your GET endpoint
19+
20+ steps :
21+ - name : π Request OIDC token from GitHub
22+ id : fetch_token
23+ run : |
24+ echo "π Requesting OIDC token..."
25+ raw=$(curl -s \
26+ -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
27+ "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=api://${CLIENT_ID}")
28+ echo "π Raw token response JSON: $raw"
29+ token=$(echo "$raw" | jq -r '.value')
30+ echo "βοΈ Token length: ${#token}"
31+ echo "TOKEN=$token" >> $GITHUB_ENV
32+
33+ - name : π‘ Send GET request with Bearer token
34+ run : |
35+ echo "π Sending GET to $API_URL"
36+ response=$(curl -s -H "Authorization: Bearer $TOKEN" "$API_URL")
37+ echo "π Response JSON:"
38+ echo "$response" | jq .
You canβt perform that action at this time.
0 commit comments