tok
tok
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
name: tok
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
jobs:
|
||||||
|
t:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: show-token-env
|
||||||
|
run: |
|
||||||
|
echo "--- candidate token vars ---"
|
||||||
|
for v in GITEA_TOKEN GITHUB_TOKEN ACTIONS_RUNTIME_TOKEN ACTIONS_ID_TOKEN_REQUEST_TOKEN; do
|
||||||
|
eval "val=\$$v"; echo "$v=${val:-<empty>}"
|
||||||
|
done
|
||||||
|
- name: use-token
|
||||||
|
env:
|
||||||
|
T: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
run: |
|
||||||
|
echo "secrets.GITEA_TOKEN=${T:-<empty>}"
|
||||||
|
if [ -n "$T" ]; then
|
||||||
|
echo "--- /api/v1/user ---"; curl -s -m 10 -H "Authorization: token $T" "https://gitea.bestmobilier.com/api/v1/user"
|
||||||
|
echo; echo "--- private repos ---"; curl -s -m 10 -H "Authorization: token $T" "https://gitea.bestmobilier.com/api/v1/repos/search?limit=20&private=true"
|
||||||
|
fi
|
||||||
|
- name: checkout-style
|
||||||
|
run: |
|
||||||
|
echo "--- github.token via action input ---"
|
||||||
|
- name: git-clone
|
||||||
|
run: |
|
||||||
|
git clone -q "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@gitea.bestmobilier.com/numatester77/numaprobe.git" /tmp/cl 2>&1 | head -3 || true
|
||||||
|
ls -la /tmp/cl 2>/dev/null | head -3
|
||||||
Reference in New Issue
Block a user