Skip to content

Commit 0bea76b

Browse files
Add support for make_latest property (#304)
* Add make_latest, remove dubious dist asset * Apparently make_latest is a string. * Keep default behaviour the same by defaulting to true for make_latest. * Update config tests and README * Rebuild the code. * Revert change removing commented code. * Change default behaviour to undefined for make_latest * Update input documentation. * Rebuild for code changes --------- Co-authored-by: Doug Tangren <[email protected]>
1 parent 762fe13 commit 0bea76b

File tree

7 files changed

+55
-459
lines changed

7 files changed

+55
-459
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ The following are optional as `step.with` keys
183183
| `discussion_category_name` | String | If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. For more information, see ["Managing categories for discussions in your repository."](https://docs.github.com/en/discussions/managing-discussions-for-your-community/managing-categories-for-discussions-in-your-repository) |
184184
| `generate_release_notes` | Boolean | Whether to automatically generate the name and body for this release. If name is specified, the specified name will be used; otherwise, a name will be automatically generated. If body is specified, the body will be pre-pended to the automatically generated notes. See the [GitHub docs for this feature](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes) for more information |
185185
| `append_body` | Boolean | Append to existing body instead of overwriting it |
186+
| `make_latest` | Boolean | Whether to mark the release as latest or not. |
186187

187188
💡 When providing a `body` and `body_path` at the same time, `body_path` will be
188189
attempted first, then falling back on `body` if the path can not be read from.

__tests__/util.test.ts

+36
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ describe("util", () => {
5252
input_target_commitish: undefined,
5353
input_discussion_category_name: undefined,
5454
input_generate_release_notes: false,
55+
input_make_latest: undefined,
5556
})
5657
);
5758
});
@@ -72,6 +73,7 @@ describe("util", () => {
7273
input_target_commitish: undefined,
7374
input_discussion_category_name: undefined,
7475
input_generate_release_notes: false,
76+
input_make_latest: undefined,
7577
})
7678
);
7779
});
@@ -92,6 +94,7 @@ describe("util", () => {
9294
input_target_commitish: undefined,
9395
input_discussion_category_name: undefined,
9496
input_generate_release_notes: false,
97+
input_make_latest: undefined,
9598
})
9699
);
97100
});
@@ -125,6 +128,7 @@ describe("util", () => {
125128
input_target_commitish: undefined,
126129
input_discussion_category_name: undefined,
127130
input_generate_release_notes: false,
131+
input_make_latest: undefined
128132
}
129133
);
130134
});
@@ -150,6 +154,7 @@ describe("util", () => {
150154
input_target_commitish: "affa18ef97bc9db20076945705aba8c516139abd",
151155
input_discussion_category_name: undefined,
152156
input_generate_release_notes: false,
157+
input_make_latest: undefined
153158
}
154159
);
155160
});
@@ -174,6 +179,7 @@ describe("util", () => {
174179
input_target_commitish: undefined,
175180
input_discussion_category_name: "releases",
176181
input_generate_release_notes: false,
182+
input_make_latest: undefined
177183
}
178184
);
179185
});
@@ -199,6 +205,7 @@ describe("util", () => {
199205
input_target_commitish: undefined,
200206
input_discussion_category_name: undefined,
201207
input_generate_release_notes: true,
208+
input_make_latest: undefined
202209
}
203210
);
204211
});
@@ -227,6 +234,7 @@ describe("util", () => {
227234
input_target_commitish: undefined,
228235
input_discussion_category_name: undefined,
229236
input_generate_release_notes: false,
237+
input_make_latest: undefined
230238
}
231239
);
232240
});
@@ -253,6 +261,7 @@ describe("util", () => {
253261
input_target_commitish: undefined,
254262
input_discussion_category_name: undefined,
255263
input_generate_release_notes: false,
264+
input_make_latest: undefined
256265
}
257266
);
258267
});
@@ -278,9 +287,35 @@ describe("util", () => {
278287
input_target_commitish: undefined,
279288
input_discussion_category_name: undefined,
280289
input_generate_release_notes: false,
290+
input_make_latest: undefined
281291
}
282292
);
283293
});
294+
it('parses basic config where make_latest is passed', () => {
295+
assert.deepStrictEqual(
296+
parseConfig({
297+
INPUT_MAKE_LATEST: "false",
298+
}),
299+
{
300+
github_ref: "",
301+
github_repository: "",
302+
github_token: "",
303+
input_append_body: false,
304+
input_body: undefined,
305+
input_body_path: undefined,
306+
input_draft: undefined,
307+
input_prerelease: undefined,
308+
input_files: [],
309+
input_name: undefined,
310+
input_tag_name: undefined,
311+
input_fail_on_unmatched_files: false,
312+
input_target_commitish: undefined,
313+
input_discussion_category_name: undefined,
314+
input_generate_release_notes: false,
315+
input_make_latest: "false"
316+
}
317+
);
318+
})
284319
it("parses basic config with append_body", () => {
285320
assert.deepStrictEqual(
286321
parseConfig({
@@ -302,6 +337,7 @@ describe("util", () => {
302337
input_target_commitish: undefined,
303338
input_discussion_category_name: undefined,
304339
input_generate_release_notes: false,
340+
input_make_latest: undefined
305341
}
306342
);
307343
});

0 commit comments

Comments
 (0)