Skip to content

Commit c90a1db

Browse files
authored
Update check changelog CI (#313)
1 parent 204fd4b commit c90a1db

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

.github/workflows/ChangeLogCheck.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,32 @@ on:
88
jobs:
99
changelog:
1010
runs-on: ubuntu-latest
11+
if: ${{ !github.event.pull_request.draft }}
1112
steps:
12-
- uses: dangoslen/changelog-enforcer@v3
13-
with:
14-
skipLabels: 'Skip ChangeLog'
13+
# check whether CHANGELOG.md is updated
14+
- uses: dangoslen/changelog-enforcer@v3
15+
with:
16+
skipLabels: 'Skip ChangeLog'
17+
18+
# check whether the format of CHANGELOG.md is correct
19+
- uses: actions/checkout@v4
20+
- uses: julia-actions/setup-julia@v2
21+
with:
22+
version: '1'
23+
- name: Install and Run Changelog
24+
run: |
25+
julia -e 'import Pkg; Pkg.add("Changelog")'
26+
julia -e 'using Changelog; Changelog.generate(Changelog.CommonMark(), "CHANGELOG.md"; repo = "qutip/QuantumToolbox.jl")'
27+
28+
- name: CHANGELOG Format Check
29+
run: |
30+
julia -e '
31+
output = Cmd(`git diff --name-only`) |> read |> String
32+
if output == ""
33+
exit(0)
34+
else
35+
@error "The format of CHANGELOG.md is not correct !!!"
36+
write(stdout, "Please format it by running the following command:\n")
37+
write(stdout, "make changelog")
38+
exit(1)
39+
end'

0 commit comments

Comments
 (0)