ci/github-script: use real @actions/core
This allows building markdown summaries, which is hard to mock.
This commit is contained in:
@@ -1 +1,2 @@
|
||||
package-lock-only = true
|
||||
save-exact = true
|
||||
|
||||
1
ci/github-script/package-lock.json
generated
1
ci/github-script/package-lock.json
generated
@@ -6,6 +6,7 @@
|
||||
"": {
|
||||
"dependencies": {
|
||||
"@actions/artifact": "2.3.2",
|
||||
"@actions/core": "1.11.1",
|
||||
"@actions/github": "6.0.1",
|
||||
"bottleneck": "2.19.5",
|
||||
"commander": "14.0.0"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@actions/artifact": "2.3.2",
|
||||
"@actions/core": "1.11.1",
|
||||
"@actions/github": "6.0.1",
|
||||
"bottleneck": "2.19.5",
|
||||
"commander": "14.0.0"
|
||||
|
||||
@@ -4,6 +4,7 @@ import { mkdtempSync, rmSync } from 'node:fs'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { program } from 'commander'
|
||||
import * as core from '@actions/core'
|
||||
import { getOctokit } from '@actions/github'
|
||||
|
||||
async function run(action, owner, repo, pull_number, dry) {
|
||||
@@ -22,6 +23,7 @@ async function run(action, owner, repo, pull_number, dry) {
|
||||
const tmp = mkdtempSync(join(tmpdir(), 'github-script-'))
|
||||
try {
|
||||
process.env.GITHUB_WORKSPACE = tmp
|
||||
process.env['INPUT_GITHUB-TOKEN'] = token
|
||||
process.chdir(tmp)
|
||||
|
||||
await action({
|
||||
@@ -33,18 +35,7 @@ async function run(action, owner, repo, pull_number, dry) {
|
||||
repo,
|
||||
},
|
||||
},
|
||||
core: {
|
||||
getInput() {
|
||||
return token
|
||||
},
|
||||
error: console.error,
|
||||
info: console.log,
|
||||
notice: console.log,
|
||||
setFailed(msg) {
|
||||
console.error(msg)
|
||||
process.exitCode = 1
|
||||
},
|
||||
},
|
||||
core,
|
||||
dry,
|
||||
})
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user