Skip to content

Commit 1a97217

Browse files
authored
feat: apidiff-go release prerequisites (#1433)
* feat: support workflow_dispatch events * feat: add ref and sha to summary output * fix: simplify determination of head/base ref * chore: cleanup unused stuff * misc formatting * fix: update summary output snapshots * feat: copy summary file, and output path * feat: simple version recommendation * chore: update dist, readme * add changesets * fix: add github-token input
1 parent 01ae4e7 commit 1a97217

File tree

18 files changed

+298
-2037
lines changed

18 files changed

+298
-2037
lines changed

.changeset/fuzzy-lambs-bow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"apidiff-go": minor
3+
---
4+
5+
feat: support workflow_dispatch events, forcing base/head ref override inputs

.changeset/ripe-foxes-fix.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"apidiff-go": minor
3+
---
4+
5+
feat: add version recommendations (patch/minor/major) based on api changes

.changeset/simple-flames-grin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"apidiff-go": minor
3+
---
4+
5+
feat: copy github step summary file, and add summary-path as an action output

.changeset/stale-sparks-heal.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"apidiff-go": patch
3+
---
4+
5+
feat: add ref, and resolved ref to summary output

actions/apidiff-go/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ Github event triggered the invocation.
3636
[event payload](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=synchronize#pull_request).
3737
- `push` - uses the `before`/`after` from the
3838
[event payload](https://docs.github.com/en/webhooks/webhook-events-and-payloads#push)
39+
- `workflow_dispatch` events require `base-ref-override` and `head-ref-override`
40+
inputs.
41+
42+
#### Outputs
43+
44+
1. `version-recommendation` - based on the changes, this will output `patch`,
45+
`minor`, or `major`
46+
2. `summary-path` - a copy of the summary, written to disk. To be used for
47+
release notes if needed
48+
- This should be written to a `summary.md` at the root of the module
3949

4050
### Example Workflow
4151

actions/apidiff-go/action.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ runs:
77
using: "node20"
88
main: "dist/index.js"
99

10+
outputs:
11+
version-recommendation:
12+
description: |
13+
A recommendation for the next version number based on the detected API
14+
changes. Possible values are 'patch', 'minor', 'major'.
15+
16+
summary-path:
17+
description: |
18+
Path to the summary file generated by the action. This will be a copy of the ${GITHUB_STEP_SUMMARY} file.
19+
1020
inputs:
1121
# path inputs
1222
repository-root:
@@ -57,6 +67,11 @@ inputs:
5767
default: "latest"
5868

5969
# misc inputs - dont touch these
70+
github-token:
71+
description: "GitHub token to use for authentication"
72+
default: ${{ github.token }}
73+
required: true
74+
6075
summary-url:
6176
description:
6277
"URL linking to the full apidiff report. This is included in the comment

0 commit comments

Comments
 (0)