Skip to content

Commit

Permalink
More testings
Browse files Browse the repository at this point in the history
  • Loading branch information
mcalthrop committed Dec 9, 2024
1 parent 1f90756 commit 8241417
Showing 1 changed file with 32 additions and 5 deletions.
37 changes: 32 additions & 5 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ jobs:
- name: curl npm registry
run: curl https://registry.npmjs.org/@mands%2fnx-playwright

- name: Env vars
env:
SAML_ACCOUNT_TOKEN: ${{ secrets.SAML_ACCOUNT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
set -x
echo "SAML_ACCOUNT_TOKEN=$(echo $SAML_ACCOUNT_TOKEN | base64 | base64)"
echo "GITHUB_TOKEN=$(echo $GITHUB_TOKEN | base64 | base64)"
echo "NPM_TOKEN=$(echo $NPM_TOKEN | base64 | base64)"
- name: Try gh command-line tool with SAML_ACCOUNT_TOKEN
env:
GH_TOKEN: ${{ secrets.SAML_ACCOUNT_TOKEN }}
Expand All @@ -31,7 +42,6 @@ jobs:
set -x
gh auth token
gh auth status
gh org list
gh status
- name: Try gh command-line tool with GITHUB_TOKEN
Expand All @@ -44,24 +54,41 @@ jobs:
set -x
gh auth token
gh auth status
gh org list
gh status
- name: Check validity of SAML_ACCOUNT_TOKEN
if: always()
env:
SAML_ACCOUNT_TOKEN: ${{ secrets.SAML_ACCOUNT_TOKEN }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x
# Trying solution described here:
# https://onecompiler.com/questions/3uxsn58yz/how-to-test-a-github-access-token-is-valid
curl -v -H "Authorization: token ${TOKEN}" https://api.github.com/issues
# Now from here:
# https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/issues
- name: Check validity of SAML_ACCOUNT_TOKEN
if: always()
env:
TOKEN: ${{ secrets.SAML_ACCOUNT_TOKEN }}
run: |
set -x
# Trying solution described here:
# https://onecompiler.com/questions/3uxsn58yz/how-to-test-a-github-access-token-is-valid
curl -v -H "Authorization: token ${SAML_ACCOUNT_TOKEN}" https://api.github.com/issues
curl -v -H "Authorization: token ${TOKEN}" https://api.github.com/issues
# Now from here:
# https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${SAML_ACCOUNT_TOKEN}" \
-H "Authorization: Bearer ${TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/issues
Expand Down

0 comments on commit 8241417

Please sign in to comment.