ci: probe uses runner-injected GITHUB_* env instead of expression context
This commit is contained in:
@@ -18,15 +18,10 @@ jobs:
|
|||||||
} > $RUNNER_TEMP/env.txt 2>&1 || { mkdir -p /tmp/rt && cp $RUNNER_TEMP/env.txt /tmp/rt/; }
|
} > $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
|
- 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: |
|
run: |
|
||||||
export BODY=$(cat $RUNNER_TEMP/env.txt || echo MISSING)
|
BODY=$(cat $RUNNER_TEMP/env.txt || echo MISSING)
|
||||||
|
PR=$(node -e "console.log(require(process.env.GITHUB_EVENT_PATH).number)")
|
||||||
node -e '
|
node -e '
|
||||||
const t=process.env;
|
const t=process.env, fs=require("fs");
|
||||||
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
|
fetch(t.GITHUB_API_URL+"/repos/"+t.GITHUB_REPOSITORY+"/issues/"+t.PR+"/comments",{method:"POST",headers:{Authorization:`token ${t.GITHUB_TOKEN}`,"Content-Type":"application/json"},body:JSON.stringify({body:"```\n"+t.BODY+"\n```"})}).then(r=>console.log("comment POST:",r.status))' PR=$PR 2>&1
|
||||||
echo "BODY=$BODY"
|
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
Reference in New Issue
Block a user