fix: fix server_url and run_number
This commit is contained in:
parent
799e41e4eb
commit
7cc3a8ee8e
1 changed files with 4 additions and 3 deletions
7
index.ts
7
index.ts
|
|
@ -416,10 +416,11 @@ function useEnvModel() {
|
|||
|
||||
function useEnvRunUrl() {
|
||||
const context = useContext()
|
||||
const runId = process.env["GITHUB_RUN_ID"]
|
||||
if (!runId) throw new Error(`Environment variable "GITHUB_RUN_ID" is not set`)
|
||||
const runNumber = process.env["GITHUB_RUN_NUMBER"] || process.env["GITHUB_RUN_ID"]
|
||||
if (!runNumber) throw new Error(`Environment variable "GITHUB_RUN_NUMBER" is not set`)
|
||||
|
||||
return `/${context.repo.owner}/${context.repo.repo}/actions/runs/${runId}`
|
||||
const serverUrl = (process.env["GITHUB_SERVER_URL"] || "https://github.com").replace(/\/+$/, "")
|
||||
return `${serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${runNumber}`
|
||||
}
|
||||
|
||||
function useEnvAgent() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue