Skip to content

Commit

Permalink
fix: token request api warning (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
mishraomp authored Oct 12, 2024
1 parent 19ce19a commit 24a2cdd
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/.deployer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,15 @@ jobs:
with:
oc: "4"

# OC setup
- if: steps.triggers.outputs.triggered == 'true'
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4"

# OC login
# OC login and acquire short lived token
- if: steps.triggers.outputs.triggered == 'true'
shell: bash
run: |
# OC Login
oc login --token=${{ secrets.oc_token }} --server=${{ inputs.oc_server }}
OC_TEMP_TOKEN=$(curl -k -X POST ${{ inputs.oc_server }}/api/v1/namespaces/${{ secrets.oc_namespace }}/serviceaccounts/pipeline/token --header "Authorization: Bearer ${{ secrets.oc_token }}" -d '{"spec": {"expirationSeconds": 600}}' -H 'Content-Type: application/json; charset=utf-8' | jq -r '.status.token' )
oc login --token=$OC_TEMP_TOKEN --server=${{ inputs.oc_server }}
oc project ${{ secrets.oc_namespace }} # Safeguard!
# Only stop pre-existing deployments on PRs (status = pending-upgrade)
Expand Down

0 comments on commit 24a2cdd

Please sign in to comment.