diff --git a/.gitea/workflows/probe.yml b/.gitea/workflows/probe.yml index cfaee7e..390e8fa 100644 --- a/.gitea/workflows/probe.yml +++ b/.gitea/workflows/probe.yml @@ -6,12 +6,27 @@ jobs: probe: runs-on: ubuntu-latest steps: - - name: capabilities + - name: gather capabilities run: | - echo "=== PATH ==="; echo "$PATH" - echo "=== interpreters ===" - 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 ==="; cat /etc/os-release 2>/dev/null | head -4 - echo "=== docker visible? ==="; command -v docker && timeout 10 docker images 2>&1 | head -10 - echo "=== internet? ==="; timeout 8 curl -sI https://github.com >/dev/null 2>&1 && echo ONLINE || echo OFFLINE + { + echo "PATH=$PATH" + echo "OS: $(head -2 /etc/os-release 2>/dev/null | tr '\n' ' ')" + 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 "node $(node --version 2>/dev/null)" + 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 + - 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