File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -23,16 +23,22 @@ jobs:
2323 - name : Build Ansible collection
2424 run : ansible-galaxy collection build --force
2525
26- - name : Authenticate with Red Hat SSO (HARDCODED for testing)
26+ - name : Get access token from sso.redhat.com
27+ id : get_token
2728 run : |
28- ACCESS_TOKEN=$(curl 'https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token' --data-urlencode 'grant_type=client_credentials' --data-urlencode 'client_id=XXXXX' --data-urlencode 'client_secret=YYYYY' --data-urlencode 'scope=openid api.iam.service_accounts")
29+ response=$(curl 'https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token' \
30+ --data-urlencode 'grant_type=client_credentials' \
31+ --data-urlencode 'client_id=88bb9cac-3213-4906-9b28-97f1c4970574' \
32+ --data-urlencode 'client_secret=Gn64GXQq0e6jgjkSOy4K7TAEbkKAXV9y' \
33+ --data-urlencode 'scope=openid api.iam.service_accounts')
2934
30- echo "ACCESS_TOKEN=$ACCESS_TOKEN" >> $GITHUB_ENV
31- echo $GITHUB_ENV
35+ access_token=$(echo "$response" | jq -r '.access_token')
36+ echo "access_token=$access_token" >> $GITHUB_OUTPUT
37+
3238
3339 - name : Publish to Red Hat Automation Hub
3440 run : |
3541 FILE=$(ls ./*.tar.gz | head -n 1)
3642 ansible-galaxy collection publish "$FILE" \
37- --server https://console.redhat.com/api/automation-hub/ \
38- --token $ACCESS_TOKEN
43+ --server https://console.redhat.com/api/automation-hub/content/vmware.alb \
44+ --token ${{ steps.get_token.outputs.access_token }}
You can’t perform that action at this time.
0 commit comments