Skip to content

Commit 9a2dbd1

Browse files
committed
1 parent 9f3cb5a commit 9a2dbd1

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,11 @@ jobs:
123123
```
124124

125125
![The workflow summary](docs/action-matrix-summary.png)
126+
127+
## Summary
128+
129+
The action writes a [GitHub Actions Job
130+
Summary](https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/)
131+
with values it identified:
132+
133+
![Job summary](docs/job-summary.png)

docs/job-summary.png

33.4 KB
Loading

src/main.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,23 @@ async function run(): Promise<void> {
3232
core.info(`minimal go version: ${min} - from go.mod`)
3333
core.info(`latest go version: ${lat} - from https://go.dev/dl/`)
3434
core.info(`go version matrix: ${mat} - from https://go.dev/dl/`)
35+
36+
const htmlMat = mat
37+
.map(v => `<a href="https://go.dev/doc/go${v}">Go ${v}</a>`)
38+
.join('<br>')
39+
40+
await core.summary
41+
.addTable([
42+
[
43+
{data: 'Output', header: true},
44+
{data: 'Value', header: true}
45+
],
46+
['Module', `<a href="https://pkg.go.dev/${name}">${name}</a>`],
47+
['Minimal', `<a href="https://go.dev/doc/go${min}">Go ${min}</a>`],
48+
['Latest', `<a href="https://go.dev/doc/go${lat}">Go ${lat}</a>`],
49+
['Matrix', `${htmlMat}`]
50+
])
51+
.write()
3552
} catch (error) {
3653
core.setFailed((error as Error).message)
3754
}

0 commit comments

Comments
 (0)