Skip to content

Commit 0fdc9fd

Browse files
committed
feat(github): Update changelog workflow and config
1 parent 65aaa4b commit 0fdc9fd

File tree

4 files changed

+23
-28
lines changed

4 files changed

+23
-28
lines changed

.actrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--container-architecture linux/amd64
2+
--env-file .env
3+
--secret-file .env

.github/tag-changelog-config.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,23 @@ module.exports = {
1313
{ types: ['other', 'Other'], label: 'Other Changes' },
1414
],
1515

16-
excludeTypes: ['other'],
16+
excludeTypes: [],
1717

1818
renderTypeSection: function (label, commits) {
19-
let text = `\n## ${ label }\n`
19+
let text = `\n## ${ label }\n\n`
2020

2121
commits.forEach((commit) => {
22-
text += `- ${ commit.subject }\n`
22+
const scope = commit.scope ? `**${ commit.scope }:** ` : ''
23+
text += `- ${ scope }${ commit.subject }\n`
2324
})
2425

2526
return text
2627
},
2728

2829
renderChangelog: function (release, changes) {
2930
const now = new Date()
30-
return `# ${ release } - ${ now.toISOString().substring(0, 10) }\n` + changes + '\n\n'
31+
const d = now.toISOString().substring(0, 10);
32+
const header = `# ${ release } - ${ d }\n`;
33+
return header + changes + '\n\n'
3134
},
3235
}

.github/workflows/changelog.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
uses: loopwerk/tag-changelog@v1
1616
with:
1717
token: ${{ secrets.GITHUB_TOKEN }}
18-
config_file: .github/tag-changelog-config.js
18+
config_file: ./../.github/tag-changelog-config.js
1919

2020
- name: "Echo results"
2121
id: output-changelog

.github/workflows/new-release.yml

+12-23
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,23 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v3 # Checkout our working repository
2020

21-
- uses: fregante/daily-version-action@v2
22-
name: Create tag if necessary
21+
- name: Create tag if necessary
22+
uses: fregante/daily-version-action@v2
2323
id: daily-version
2424

25-
- name: Conventional Changelog Action
25+
- name: Create changelog text
2626
if: steps.daily-version.outputs.created
2727
id: changelog
28-
uses: TriPSs/conventional-changelog-action@v3
28+
uses: loopwerk/tag-changelog@v1
2929
with:
30-
github-token: ${{ secrets.GITHUB_TOKEN }}
31-
skip-git-pull: "true"
32-
output-file: "false"
33-
fallback-version: "${{ steps.daily-version.outputs.version }}"
34-
skip-version-file: "true"
35-
git-message: "chore(release): {version}"
36-
git-user-name: "${{ github.actor }}"
37-
git-user-email: "${{ github.actor }}@users.noreply.github.com"
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
config_file: ./../.github/tag-changelog-config.js
3832

3933
- name: Create release
40-
if: env.DAILY_VERSION_CREATED
41-
uses: actions/[email protected]
34+
uses: actions/create-release@latest
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4237
with:
43-
github-token: ${{ secrets.GITHUB_TOKEN }}
44-
script: |
45-
await github.request(
46-
`POST /repos/${{ github.repository }}/releases`,
47-
{
48-
tag_name: "${{ steps.daily-version.outputs.version }}",
49-
body: "${{ steps.daily-version.outputs.clean_changelog }}"
50-
}
51-
);
38+
tag_name: ${{ steps.daily-version.outputs.version }}
39+
release_name: Release ${{ steps.daily-version.outputs.version }}
40+
body: ${{ steps.changelog.outputs.changes }}

0 commit comments

Comments
 (0)