mirror of
https://github.com/darksaid98/auto-changelog.git
synced 2026-12-03 14:38:47 +00:00
breaking: Separate deps type from build
This commit is contained in:
3 files changed
+29
-31
No files matched your search
@@ -13,9 +13,10 @@ type(category): description [flag]
|
|||||||
The `type` must be one of the followings:
|
The `type` must be one of the followings:
|
||||||
|
|
||||||
* `breaking` (Breaking Changes)
|
* `breaking` (Breaking Changes)
|
||||||
* `build` (Build System / Dependencies)
|
* `build` (Build System)
|
||||||
* `ci` (Continuous Integration)
|
* `ci` (Continuous Integration)
|
||||||
* `chore` (Chores)
|
* `chore` (Chores)
|
||||||
|
* `deps` (Dependencies)
|
||||||
* `docs` (Documentation Changes)
|
* `docs` (Documentation Changes)
|
||||||
* `feat` (New Features)
|
* `feat` (New Features)
|
||||||
* `fix` (Bug Fixes)
|
* `fix` (Bug Fixes)
|
||||||
|
|||||||
+2
-1
@@ -105,9 +105,10 @@ const PR_REGEX = /#([1-9]\d*)/g;
|
|||||||
|
|
||||||
const TYPES = {
|
const TYPES = {
|
||||||
breaking: "Breaking Changes",
|
breaking: "Breaking Changes",
|
||||||
build: "Build System / Dependencies",
|
build: "Build System",
|
||||||
ci: "Continuous Integration",
|
ci: "Continuous Integration",
|
||||||
chore: "Chores",
|
chore: "Chores",
|
||||||
|
deps: "Dependencies",
|
||||||
docs: "Documentation Changes",
|
docs: "Documentation Changes",
|
||||||
feat: "New Features",
|
feat: "New Features",
|
||||||
fix: "Bug Fixes",
|
fix: "Bug Fixes",
|
||||||
|
|||||||
+25
-29
@@ -1,39 +1,35 @@
|
|||||||
import { info, getInput, setOutput, setFailed } from "@actions/core";
|
import { getInput, info, setFailed, setOutput } from "@actions/core";
|
||||||
import { context, getOctokit } from "@actions/github";
|
import { context, getOctokit } from "@actions/github";
|
||||||
import { generate } from "./changelog";
|
import { generate } from "./changelog";
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
try {
|
const token = getInput("token", { required: true });
|
||||||
const token = getInput("token", { required: true });
|
const exclude = getInput("exclude", { required: false }).split(",");
|
||||||
const exclude = getInput("exclude", { required: false }).split(",");
|
const octokit = getOctokit(token);
|
||||||
const octokit = getOctokit(token);
|
const {
|
||||||
const {
|
repo: { owner, repo },
|
||||||
repo: { owner, repo },
|
sha,
|
||||||
sha,
|
} = context;
|
||||||
} = context;
|
|
||||||
|
|
||||||
const { data: tags } = await octokit.repos.listTags({
|
const { data: tags } = await octokit.repos.listTags({
|
||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
per_page: 2,
|
per_page: 2,
|
||||||
});
|
});
|
||||||
|
|
||||||
let tagRef: string | undefined;
|
let tagRef: string | undefined;
|
||||||
|
|
||||||
if (tags.length > 0) {
|
if (tags.length > 0) {
|
||||||
if (sha === tags[0].commit.sha) {
|
if (sha === tags[0].commit.sha) {
|
||||||
if (tags.length > 1) tagRef = tags[1].commit.sha;
|
if (tags.length > 1) tagRef = tags[1].commit.sha;
|
||||||
} else tagRef = tags[0].commit.sha;
|
} else tagRef = tags[0].commit.sha;
|
||||||
}
|
|
||||||
|
|
||||||
const changelog = await generate(octokit, exclude, owner, repo, tagRef);
|
|
||||||
|
|
||||||
info(changelog);
|
|
||||||
|
|
||||||
setOutput("changelog", changelog);
|
|
||||||
} catch (error) {
|
|
||||||
setFailed(error.message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const changelog = await generate(octokit, exclude, owner, repo, tagRef);
|
||||||
|
|
||||||
|
info(changelog);
|
||||||
|
|
||||||
|
setOutput("changelog", changelog);
|
||||||
}
|
}
|
||||||
|
|
||||||
run();
|
run().catch((error) => setFailed(error.message));
|
||||||
Reference in new issue
Block a user