@vavt/github-action-test 0.0.5 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -63,25 +63,85 @@ jobs:
63
63
  '<!-- next-release -->' > CHANGELOG.md
64
64
  fi
65
65
 
66
- if grep -q "^## ${TAG_NAME} (" CHANGELOG.md; then
66
+ DISPLAY_VERSION="${TAG_NAME#v}"
67
+
68
+ if grep -q "^## ${TAG_NAME} (" CHANGELOG.md || grep -q "^## ${DISPLAY_VERSION} (" CHANGELOG.md; then
67
69
  echo "CHANGELOG already contains ${TAG_NAME}, skip update."
68
70
  exit 0
69
71
  fi
70
72
 
71
73
  NOTES="$(gh release view "${TAG_NAME}" --json body --jq '.body')"
72
74
  DATE="$(date -u +%Y-%m-%d)"
75
+ MARKER='<!-- next-release -->'
76
+
77
+ printf '%s\n' "${NOTES}" | sed 's/\r$//' > /tmp/release-notes.raw.md
73
78
 
74
- printf '## %s (%s)\n\n%s\n\n%s\n' \
75
- "${TAG_NAME}" \
76
- "${DATE}" \
77
- "${NOTES}" \
78
- '<!-- next-release -->' > /tmp/release-entry.md
79
+ sed \
80
+ -e "/^## What's Changed$/d" \
81
+ -e '/^## New Contributors$/,/^\*\*Full Changelog\*\*/d' \
82
+ -e '/^\*\*Full Changelog\*\*/d' \
83
+ -e 's/^\* /- /' \
84
+ /tmp/release-notes.raw.md > /tmp/release-notes.cleaned.md
79
85
 
80
86
  awk '
81
- FNR==NR { entry = entry $0 ORS; next }
82
- $0 == "<!-- next-release -->" { printf "%s", entry; next }
83
- { print }
84
- ' /tmp/release-entry.md CHANGELOG.md > /tmp/CHANGELOG.md
87
+ BEGIN { started = 0 }
88
+ {
89
+ if (!started && $0 ~ /^[[:space:]]*$/) {
90
+ next
91
+ }
92
+ started = 1
93
+ lines[++n] = $0
94
+ }
95
+ END {
96
+ while (n > 0 && lines[n] ~ /^[[:space:]]*$/) {
97
+ n--
98
+ }
99
+ for (i = 1; i <= n; i++) {
100
+ print lines[i]
101
+ }
102
+ }
103
+ ' /tmp/release-notes.cleaned.md > /tmp/release-notes.trimmed.md
104
+
105
+ mv /tmp/release-notes.trimmed.md /tmp/release-notes.cleaned.md
106
+
107
+ if [ ! -s /tmp/release-notes.cleaned.md ]; then
108
+ printf '### Changes\n\n- Internal maintenance updates.\n' > /tmp/release-notes.cleaned.md
109
+ elif ! grep -q '^### ' /tmp/release-notes.cleaned.md; then
110
+ {
111
+ printf '### Changes\n\n'
112
+ cat /tmp/release-notes.cleaned.md
113
+ } > /tmp/release-notes.with-section.md
114
+ mv /tmp/release-notes.with-section.md /tmp/release-notes.cleaned.md
115
+ fi
116
+
117
+ {
118
+ printf '## %s (%s)\n\n' "${DISPLAY_VERSION}" "${DATE}"
119
+ printf -- '---\n\n'
120
+ cat /tmp/release-notes.cleaned.md
121
+ printf '\n'
122
+ } > /tmp/release-entry.md
123
+
124
+ grep -vF "${MARKER}" CHANGELOG.md > /tmp/changelog-base.md || true
125
+
126
+ FIRST_SECTION_LINE="$(grep -n '^## ' /tmp/changelog-base.md | head -n1 | cut -d: -f1 || true)"
127
+
128
+ if [ -n "${FIRST_SECTION_LINE}" ]; then
129
+ head -n "$((FIRST_SECTION_LINE - 1))" /tmp/changelog-base.md > /tmp/changelog-prefix.md
130
+ tail -n "+${FIRST_SECTION_LINE}" /tmp/changelog-base.md > /tmp/changelog-sections.md
131
+ else
132
+ cp /tmp/changelog-base.md /tmp/changelog-prefix.md
133
+ : > /tmp/changelog-sections.md
134
+ fi
135
+
136
+ {
137
+ cat /tmp/changelog-prefix.md
138
+ printf '\n%s\n\n' "${MARKER}"
139
+ cat /tmp/release-entry.md
140
+ if [ -s /tmp/changelog-sections.md ]; then
141
+ printf '\n'
142
+ cat /tmp/changelog-sections.md
143
+ fi
144
+ } > /tmp/CHANGELOG.md
85
145
 
86
146
  mv /tmp/CHANGELOG.md CHANGELOG.md
87
147
 
package/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+
6
+ <!-- next-release -->
7
+
8
+ ## v0.1.0 (2026-02-28)
9
+
10
+ <!-- Release notes generated using configuration in .github/release.yml at v0.1.0 -->
11
+
12
+
13
+
14
+ **Full Changelog**: https://github.com/imzbf/github-action-test/compare/v0.0.5...v0.1.0
15
+
5
16
  ## v0.0.3 (2026-02-28)
6
17
 
7
18
  <!-- Release notes generated using configuration in .github/release.yml at v0.0.3 -->
@@ -18,4 +29,11 @@ All notable changes to this project will be documented in this file.
18
29
 
19
30
  **Full Changelog**: https://github.com/imzbf/github-action-test/compare/v0.0.3...v0.0.4
20
31
 
21
- <!-- next-release -->
32
+ ## v0.0.5 (2026-02-28)
33
+
34
+ <!-- Release notes generated using configuration in .github/release.yml at v0.0.5 -->
35
+
36
+
37
+
38
+ **Full Changelog**: https://github.com/imzbf/github-action-test/compare/v0.0.4...v0.0.5
39
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vavt/github-action-test",
3
- "version": "0.0.5",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
package/src/main.jsx CHANGED
@@ -1,5 +1,5 @@
1
1
  const hello = () => {
2
- console.log('Hello, World! 001');
2
+ console.log('Hello, World! 004');
3
3
  };
4
4
 
5
5
  hello();