Unverified Commit 2433050f authored by Wolfgang Walther's avatar Wolfgang Walther
Browse files

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

This allows building markdown summaries, which is hard to mock.
parent cdd1931a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
package-lock-only = true
save-exact = true
+1 −0
Original line number Diff line number Diff line
@@ -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"
+1 −0
Original line number Diff line number Diff line
@@ -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"
+3 −12
Original line number Diff line number Diff line
@@ -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 {