Compare commits
7 Commits
v0.1.13
...
debug-cros
Author | SHA1 | Date | |
---|---|---|---|
e6268c631a | |||
8988630456 | |||
c1b107442c | |||
4c8c431191 | |||
1505034bb0 | |||
21e9098c3b | |||
26941a6e6b |
12
CHANGELOG.md
12
CHANGELOG.md
@ -1,15 +1,3 @@
|
|||||||
## 0.1.13
|
|
||||||
|
|
||||||
- fix issue with multiple runs concatenating release bodies [#145](https://github.com/softprops/action-gh-release/pull/145)
|
|
||||||
|
|
||||||
## 0.1.12
|
|
||||||
|
|
||||||
- fix bug leading to empty strings subsituted for inputs users don't provide breaking api calls [#144](https://github.com/softprops/action-gh-release/pull/144)
|
|
||||||
|
|
||||||
## 0.1.11
|
|
||||||
|
|
||||||
- better error message on release create failed [#143](https://github.com/softprops/action-gh-release/pull/143)
|
|
||||||
|
|
||||||
## 0.1.10
|
## 0.1.10
|
||||||
|
|
||||||
- fixed error message formatting for file uploads
|
- fixed error message formatting for file uploads
|
||||||
|
@ -11,7 +11,7 @@ import * as assert from "assert";
|
|||||||
|
|
||||||
describe("util", () => {
|
describe("util", () => {
|
||||||
describe("uploadUrl", () => {
|
describe("uploadUrl", () => {
|
||||||
it("strips template", () => {
|
it("stripts template", () => {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
uploadUrl(
|
uploadUrl(
|
||||||
"https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}"
|
"https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}"
|
||||||
@ -95,33 +95,21 @@ describe("util", () => {
|
|||||||
});
|
});
|
||||||
describe("parseConfig", () => {
|
describe("parseConfig", () => {
|
||||||
it("parses basic config", () => {
|
it("parses basic config", () => {
|
||||||
assert.deepStrictEqual(
|
assert.deepStrictEqual(parseConfig({}), {
|
||||||
parseConfig({
|
github_ref: "",
|
||||||
// note: inputs declared in actions.yml, even when declared not required,
|
github_repository: "",
|
||||||
// are still provided by the actions runtime env as empty strings instead of
|
github_token: "",
|
||||||
// the normal absent env value one would expect. this breaks things
|
input_body: undefined,
|
||||||
// as an empty string !== undefined in terms of what we pass to the api
|
input_body_path: undefined,
|
||||||
// so we cover that in a test case here to ensure undefined values are actually
|
input_draft: undefined,
|
||||||
// resolved as undefined and not empty strings
|
input_prerelease: undefined,
|
||||||
INPUT_TARGET_COMMITISH: "",
|
input_files: [],
|
||||||
INPUT_DISCUSSION_CATEGORY_NAME: ""
|
input_name: undefined,
|
||||||
}),
|
input_tag_name: undefined,
|
||||||
{
|
input_fail_on_unmatched_files: false,
|
||||||
github_ref: "",
|
input_target_commitish: undefined,
|
||||||
github_repository: "",
|
input_discussion_category_name: undefined
|
||||||
github_token: "",
|
});
|
||||||
input_body: undefined,
|
|
||||||
input_body_path: undefined,
|
|
||||||
input_draft: undefined,
|
|
||||||
input_prerelease: undefined,
|
|
||||||
input_files: [],
|
|
||||||
input_name: undefined,
|
|
||||||
input_tag_name: undefined,
|
|
||||||
input_fail_on_unmatched_files: false,
|
|
||||||
input_target_commitish: undefined,
|
|
||||||
input_discussion_category_name: undefined
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("parses basic config with commitish", () => {
|
it("parses basic config with commitish", () => {
|
||||||
|
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "action-gh-release",
|
"name": "action-gh-release",
|
||||||
"version": "0.1.13",
|
"version": "0.1.8",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "action-gh-release",
|
"name": "action-gh-release",
|
||||||
"version": "0.1.13",
|
"version": "0.1.10",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "GitHub Action for creating GitHub Releases",
|
"description": "GitHub Action for creating GitHub Releases",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
|
@ -229,11 +229,12 @@ export const release = async (
|
|||||||
|
|
||||||
const tag_name = tag;
|
const tag_name = tag;
|
||||||
const name = config.input_name || existingRelease.data.name || tag;
|
const name = config.input_name || existingRelease.data.name || tag;
|
||||||
// revisit: support a new body-concat-strategy input for accumulating
|
|
||||||
// body parts as a release gets updated. some users will likely want this while
|
let body: string = "";
|
||||||
// others won't previously this was duplicating content for most which
|
if (existingRelease.data.body) body += existingRelease.data.body;
|
||||||
// no one wants
|
let workflowBody = releaseBody(config);
|
||||||
let body = releaseBody(config) || existingRelease.data.body || "";
|
if (existingRelease.data.body && workflowBody) body += "\n";
|
||||||
|
if (workflowBody) body += workflowBody;
|
||||||
|
|
||||||
const draft =
|
const draft =
|
||||||
config.input_draft !== undefined
|
config.input_draft !== undefined
|
||||||
@ -270,7 +271,7 @@ export const release = async (
|
|||||||
commitMessage = ` using commit "${target_commitish}"`;
|
commitMessage = ` using commit "${target_commitish}"`;
|
||||||
}
|
}
|
||||||
console.log(
|
console.log(
|
||||||
`👩🏭 Creating new GitHub release for tag ${tag_name}${commitMessage}...`
|
`👩🏭 Creating new GitHub release in ${owner}/${repo} for tag ${tag_name}${commitMessage}...`
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
let release = await releaser.createRelease({
|
let release = await releaser.createRelease({
|
||||||
|
@ -63,9 +63,8 @@ export const parseConfig = (env: Env): Config => {
|
|||||||
? env.INPUT_PRERELEASE == "true"
|
? env.INPUT_PRERELEASE == "true"
|
||||||
: undefined,
|
: undefined,
|
||||||
input_fail_on_unmatched_files: env.INPUT_FAIL_ON_UNMATCHED_FILES == "true",
|
input_fail_on_unmatched_files: env.INPUT_FAIL_ON_UNMATCHED_FILES == "true",
|
||||||
input_target_commitish: env.INPUT_TARGET_COMMITISH || undefined,
|
input_target_commitish: env.INPUT_TARGET_COMMITISH,
|
||||||
input_discussion_category_name:
|
input_discussion_category_name: env.INPUT_DISCUSSION_CATEGORY_NAME
|
||||||
env.INPUT_DISCUSSION_CATEGORY_NAME || undefined
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user