Support custom target_commitish value (#76)

* Make target_commitish configurable

* Store compiled action for testing

* Add target_commitish to metadata

* Allow override of target_commitish for updating

* Print commit usage

* Improve message for commit usage

* Update draft releases too

* Revert "Update draft releases too"

This reverts commit ff30f8edb1.

* Integrate latest changes from upstream.
This commit is contained in:
Thomas Piskol 2021-05-03 02:43:58 +02:00 committed by GitHub
parent cebd052c1e
commit 9729932bfb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 73 additions and 19 deletions

View file

@ -37,7 +37,8 @@ describe("util", () => {
input_prerelease: false,
input_files: [],
input_name: undefined,
input_tag_name: undefined
input_tag_name: undefined,
input_target_commitish: undefined
})
);
});
@ -54,7 +55,8 @@ describe("util", () => {
input_prerelease: false,
input_files: [],
input_name: undefined,
input_tag_name: undefined
input_tag_name: undefined,
input_target_commitish: undefined
})
);
});
@ -71,7 +73,8 @@ describe("util", () => {
input_prerelease: false,
input_files: [],
input_name: undefined,
input_tag_name: undefined
input_tag_name: undefined,
input_target_commitish: undefined
})
);
});
@ -89,10 +92,34 @@ describe("util", () => {
input_files: [],
input_name: undefined,
input_tag_name: undefined,
input_fail_on_unmatched_files: false
input_fail_on_unmatched_files: false,
input_target_commitish: undefined
});
});
});
describe("parseConfig", () => {
it("parses basic config with commitish", () => {
assert.deepStrictEqual(
parseConfig({
INPUT_TARGET_COMMITISH: "affa18ef97bc9db20076945705aba8c516139abd"
}),
{
github_ref: "",
github_repository: "",
github_token: "",
input_body: undefined,
input_body_path: undefined,
input_draft: false,
input_prerelease: false,
input_files: [],
input_name: undefined,
input_tag_name: undefined,
input_fail_on_unmatched_files: false,
input_target_commitish: "affa18ef97bc9db20076945705aba8c516139abd"
}
);
});
});
describe("isTag", () => {
it("returns true for tags", async () => {
assert.equal(isTag("refs/tags/foo"), true);