Skip to content

Commit

Permalink
Merge pull request #502 from rtyley/display-github-action-job-summary
Browse files Browse the repository at this point in the history
Display GitHub Action Job Summary
  • Loading branch information
alejandrohdezma authored Jun 15, 2023
2 parents 31bf30f + 8c4b1a0 commit b6f8161
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/action/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ async function run(): Promise<void> {
inputs.steward.extraArgs?.value.split(' ') ?? [],
])

if (files.existsSync(workspace.runSummary_md)) {
logger.info(`✓ Run Summary file: ${workspace.runSummary_md}`)

const summaryMarkdown = files.readFileSync(workspace.runSummary_md, 'utf8')
await core.summary.addRaw(summaryMarkdown).write()
}

await workspace.saveWorkspaceCache()
} catch (error: unknown) {
core.setFailed(` ✕ ${(error as Error).message}`)
Expand Down
1 change: 1 addition & 0 deletions src/modules/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export class Workspace {
readonly repos_md = mandatory(path.join(this.directory, 'repos.md'))
readonly app_pem = mandatory(path.join(this.directory, 'app.pem'))
readonly askpass_sh = mandatory(path.join(this.directory, 'askpass.sh'))
readonly runSummary_md: string = path.join(this.workspace.value, 'run-summary.md')

constructor(
private readonly logger: Logger,
Expand Down

0 comments on commit b6f8161

Please sign in to comment.