actions / actions/toolkit

Export `Summary` class

Open
#1,191 0 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

This might be useful when you want to use some helpers in tables or details, for ex.

await core.summary
  .addHeading('Notified CD pipeline with following inputs:')
  .addTable([
    [
      { data: 'Name', header: true },
      { data: 'Value', header: true },
    ],
    [
      'Other tags',
      process.env.TAGS.split('\n')
        .map((l) => l.split(':')[1])
        .reduce((s, t) => s.addCodeBlock(t).addBreak(), new Summary())
        .stringify(),
    ],
  ])
  .addDetails(
    'Details',
    new Summary()
      .addHeading('Metadata', 4)
      .addCodeBlock(process.env.METADATA, 'json')
      .stringify()
  )
  .write();

Right now it's impossible as class is not exported

https://github.com/actions/toolkit/blob/4fbc5c941a57249b19562015edbd72add14be93d/packages/core/src/summary.ts#L54

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/core/src/summary.ts around line 54, where the Summary class is defined. Make Summary publicly exportable so the example can instantiate it, then verify the package's public import surface exposes the class.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.