ci: probe reports runner capabilities via PR comment (logs endpoint 404s)
CI / validate (pull_request) Failing after 5s
CI / validate (pull_request) Failing after 5s
This commit is contained in:
@@ -6,12 +6,27 @@ jobs:
|
|||||||
probe:
|
probe:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: capabilities
|
- name: gather capabilities
|
||||||
run: |
|
run: |
|
||||||
echo "=== PATH ==="; echo "$PATH"
|
{
|
||||||
echo "=== interpreters ==="
|
echo "PATH=$PATH"
|
||||||
for c in python python3 node npx bash sh git curl wget apt apk pip pip3; do command -v $c >/dev/null 2>&1 && echo "HAVE $c: $(command -v $c)"; done
|
echo "OS: $(head -2 /etc/os-release 2>/dev/null | tr '\n' ' ')"
|
||||||
echo "=== os ==="; cat /etc/os-release 2>/dev/null | head -4
|
for c in python python3 node bash git curl wget apt apk; do command -v $c >/dev/null 2>&1 && echo "HAVE $c -> $(command -v $c)"; done
|
||||||
echo "=== docker visible? ==="; command -v docker && timeout 10 docker images 2>&1 | head -10
|
echo "node $(node --version 2>/dev/null)"
|
||||||
echo "=== internet? ==="; timeout 8 curl -sI https://github.com >/dev/null 2>&1 && echo ONLINE || echo OFFLINE
|
echo "net: $(timeout 8 curl -sI https://github.com >/dev/null 2>&1 && echo ONLINE || echo OFFLINE)"
|
||||||
|
echo "env-github: GITHUB_API_URL=${GITHUB_API_URL:-unset} REPO=${GITHUB_REPOSITORY:-unset} SHA=${GITHUB_SHA:-unset}"
|
||||||
|
} > $RUNNER_TEMP/env.txt 2>&1 || { mkdir -p /tmp/rt && cp $RUNNER_TEMP/env.txt /tmp/rt/; }
|
||||||
exit 0
|
exit 0
|
||||||
|
- name: report via PR comment
|
||||||
|
env:
|
||||||
|
PR_NUMBER: ${{ github.event.number }}
|
||||||
|
GIT_TOKEN: *** github.token }}
|
||||||
|
API_URL: ${{ github.api_url }}
|
||||||
|
REPO_NAME: ${{ github.repository }}
|
||||||
|
run: |
|
||||||
|
export BODY=$(cat $RUNNER_TEMP/env.txt || echo MISSING)
|
||||||
|
node -e '
|
||||||
|
const t=process.env;
|
||||||
|
fetch(`${t.API_URL}/repos/${t.REPO_NAME}/issues/${t.PR_NUMBER}/comments`,{method:"POST",headers:{Authorization:`token ${t.GIT_TOKEN}`,"Content-Type":"application/json"},body:JSON.stringify({body:"```\n"+t.BODY+"\n```"})}).then(r=>console.log("comment POST:",r.status))' 2>&1
|
||||||
|
echo "BODY=$BODY"
|
||||||
|
shell: bash
|
||||||
|
|||||||
Reference in New Issue
Block a user