ci/github-script: use real @actions/core

This allows building markdown summaries, which is hard to mock.
This commit is contained in:
Wolfgang Walther
2025-07-13 21:11:43 +02:00
parent cdd1931ace
commit 2433050fb7
4 changed files with 6 additions and 12 deletions

View File

@@ -1 +1,2 @@
package-lock-only = true package-lock-only = true
save-exact = true

View File

@@ -6,6 +6,7 @@
"": { "": {
"dependencies": { "dependencies": {
"@actions/artifact": "2.3.2", "@actions/artifact": "2.3.2",
"@actions/core": "1.11.1",
"@actions/github": "6.0.1", "@actions/github": "6.0.1",
"bottleneck": "2.19.5", "bottleneck": "2.19.5",
"commander": "14.0.0" "commander": "14.0.0"

View File

@@ -2,6 +2,7 @@
"private": true, "private": true,
"dependencies": { "dependencies": {
"@actions/artifact": "2.3.2", "@actions/artifact": "2.3.2",
"@actions/core": "1.11.1",
"@actions/github": "6.0.1", "@actions/github": "6.0.1",
"bottleneck": "2.19.5", "bottleneck": "2.19.5",
"commander": "14.0.0" "commander": "14.0.0"

View File

@@ -4,6 +4,7 @@ import { mkdtempSync, rmSync } from 'node:fs'
import { tmpdir } from 'node:os' import { tmpdir } from 'node:os'
import { join } from 'node:path' import { join } from 'node:path'
import { program } from 'commander' import { program } from 'commander'
import * as core from '@actions/core'
import { getOctokit } from '@actions/github' import { getOctokit } from '@actions/github'
async function run(action, owner, repo, pull_number, dry) { 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-')) const tmp = mkdtempSync(join(tmpdir(), 'github-script-'))
try { try {
process.env.GITHUB_WORKSPACE = tmp process.env.GITHUB_WORKSPACE = tmp
process.env['INPUT_GITHUB-TOKEN'] = token
process.chdir(tmp) process.chdir(tmp)
await action({ await action({
@@ -33,18 +35,7 @@ async function run(action, owner, repo, pull_number, dry) {
repo, repo,
}, },
}, },
core: { core,
getInput() {
return token
},
error: console.error,
info: console.log,
notice: console.log,
setFailed(msg) {
console.error(msg)
process.exitCode = 1
},
},
dry, dry,
}) })
} finally { } finally {