diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f048747f..7fcb15e7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,6 +4,9 @@ on: push: tags: - "*" +permissions: + contents: write + packages: read jobs: npm-publish: @@ -16,6 +19,7 @@ jobs: - run: npm install - run: npm run lint - run: npm test + - id: "publish" uses: JS-DevTools/npm-publish@v1 with: @@ -28,3 +32,14 @@ jobs: - if: steps.publish.type == 'none' run: | echo "Version not changed." + + - name: Get current tag + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Generate release changelog + run: ./src/cli/index.js preview -p $RELEASE_VERSION >> release.txt + + - name: Release + uses: softprops/action-gh-release@v1 + with: + body_path: release.txt diff --git a/package-lock.json b/package-lock.json index c26397c6..c8e1f6ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -787,11 +787,11 @@ } }, "node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-7.2.1.tgz", - "integrity": "sha512-UmlNrrcF+AXxcxhZslTt1a/8aDxUKH0trrt/mJCxEPrWbW1ZEc+6xxcd5/n0iw3b+Xo8UBJQUKDr71+vNCBpRQ==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-7.2.2.tgz", + "integrity": "sha512-bNoDKPtCL3Au0aL1sKfYhJ8uuVJ/Z3B9I2tSs1Ib68Guojv+hk++FH8Sc9ul/YTZ6S5Xr39QwJzoRCJZFKYPLA==", "dependencies": { - "@octokit/types": "^9.3.1" + "@octokit/types": "^10.0.0" }, "engines": { "node": ">= 14" @@ -800,10 +800,18 @@ "@octokit/core": ">=3" } }, + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-10.0.0.tgz", + "integrity": "sha512-Vm8IddVmhCgU1fxC1eyinpwqzXPEYu0NrYzD3YZjlGjyftdLBTeqNblRC0jmJmgxbJIsQlyogVeGnrNaaMVzIg==", + "dependencies": { + "@octokit/openapi-types": "^18.0.0" + } + }, "node_modules/@octokit/request": { - "version": "6.2.5", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.5.tgz", - "integrity": "sha512-z83E8UIlPNaJUsXpjD8E0V5o/5f+vJJNbNcBwVZsX3/vC650U41cOkTLjq4PKk9BYonQGOnx7N17gvLyNjgGcQ==", + "version": "6.2.6", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.6.tgz", + "integrity": "sha512-T/waXf/xjie8Qn5IyFYAcI/HXvw9SPkcQWErGP9H471IWRDRCN+Gn/QOptPMAZRT4lJb2bLHxQfCXjU0mJRyng==", "dependencies": { "@octokit/endpoint": "^7.0.0", "@octokit/request-error": "^3.0.0", @@ -868,9 +876,9 @@ "integrity": "sha512-I0vDR0rdtP8p2lGMzvsJzbhdOWy405HcGovrspJ8RRibHnyRgggUSNO5AIox5LmqiwmatHKYsvj6VGFHkqS7lA==" }, "node_modules/@octokit/types": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.1.tgz", - "integrity": "sha512-zfJzyXLHC42sWcn2kS+oZ/DRvFZBYCCbfInZtwp1Uopl1qh6pRg4NSP/wFX1xCOpXvEkctiG1sxlSlkZmzvxdw==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", + "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", "dependencies": { "@octokit/openapi-types": "^18.0.0" } @@ -900,9 +908,9 @@ "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, "node_modules/@pnpm/npm-conf": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.2.0.tgz", - "integrity": "sha512-roLI1ul/GwzwcfcVpZYPdrgW2W/drLriObl1h+yLF5syc8/5ULWw2ALbCHUWF+4YltIqA3xFSbG4IwyJz37e9g==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.2.2.tgz", + "integrity": "sha512-UA91GwWPhFExt3IizW6bOeY/pQ0BkuNwKjk9iQW9KqxluGCrg4VenZ0/L+2Y0+ZOtme72EVvg6v0zo3AMQRCeA==", "dependencies": { "@pnpm/config.env-replace": "^1.1.0", "@pnpm/network.ca-file": "^1.0.1", @@ -1019,9 +1027,9 @@ "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==" }, "node_modules/@types/node": { - "version": "20.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.0.tgz", - "integrity": "sha512-cumHmIAf6On83X7yP+LrsEyUOf/YlociZelmpRYaGFydoaPdxdt80MAbu6vWerQT2COCp2nPvHdsbD7tHn/YlQ==", + "version": "20.3.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.1.tgz", + "integrity": "sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==", "dev": true }, "node_modules/@types/normalize-package-data": { @@ -1249,9 +1257,9 @@ } }, "node_modules/ansi-escapes/node_modules/type-fest": { - "version": "3.11.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.11.1.tgz", - "integrity": "sha512-aCuRNRERRVh33lgQaJRlUxZqzfhzwTrsE98Mc3o3VXqmiaQdHacgUtJ0esp+7MvZ92qhtzKPeusaX6vIEcoreA==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.12.0.tgz", + "integrity": "sha512-qj9wWsnFvVEMUDbESiilKeXeHL7FwwiFcogfhfyjmvT968RXSvnl23f1JOClTHYItsi7o501C/7qVllscUP3oA==", "engines": { "node": ">=14.16" }, @@ -2063,9 +2071,9 @@ } }, "node_modules/decamelize-keys/node_modules/type-fest": { - "version": "3.11.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.11.1.tgz", - "integrity": "sha512-aCuRNRERRVh33lgQaJRlUxZqzfhzwTrsE98Mc3o3VXqmiaQdHacgUtJ0esp+7MvZ92qhtzKPeusaX6vIEcoreA==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.12.0.tgz", + "integrity": "sha512-qj9wWsnFvVEMUDbESiilKeXeHL7FwwiFcogfhfyjmvT968RXSvnl23f1JOClTHYItsi7o501C/7qVllscUP3oA==", "engines": { "node": ">=14.16" }, @@ -4879,9 +4887,9 @@ } }, "node_modules/meow/node_modules/type-fest": { - "version": "3.11.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.11.1.tgz", - "integrity": "sha512-aCuRNRERRVh33lgQaJRlUxZqzfhzwTrsE98Mc3o3VXqmiaQdHacgUtJ0esp+7MvZ92qhtzKPeusaX6vIEcoreA==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.12.0.tgz", + "integrity": "sha512-qj9wWsnFvVEMUDbESiilKeXeHL7FwwiFcogfhfyjmvT968RXSvnl23f1JOClTHYItsi7o501C/7qVllscUP3oA==", "engines": { "node": ">=14.16" }, diff --git a/src/cli/preview.js b/src/cli/preview.js index 7bc81c2e..62d17a95 100644 --- a/src/cli/preview.js +++ b/src/cli/preview.js @@ -6,7 +6,7 @@ import { newsFragmentsUserConfig } from "../config.js"; import { getChangelogContent, getFragments } from "../file.js"; marked.setOptions({ - renderer: new TerminalRenderer(), + renderer: new TerminalRenderer({ tab: 0 }), mangle: false, headerIds: false, });