@vavt/github-action-test 0.6.0 → 0.7.2
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.
- package/.github/workflows/latest.yml +66 -27
- package/CHANGELOG.md +36 -1
- package/package.json +1 -1
- package/src/main.jsx +1 -1
|
@@ -95,8 +95,12 @@ jobs:
|
|
|
95
95
|
: > "${FIXES_FILE}"
|
|
96
96
|
: > "${OTHERS_FILE}"
|
|
97
97
|
|
|
98
|
-
while IFS
|
|
98
|
+
while IFS= read -r -d '' FULL_HASH \
|
|
99
|
+
&& IFS= read -r -d '' SUBJECT \
|
|
100
|
+
&& IFS= read -r -d '' BODY; do
|
|
99
101
|
[ -z "${FULL_HASH:-}" ] && continue
|
|
102
|
+
FULL_HASH="$(printf '%s' "${FULL_HASH}" | tr -d '\r\n[:space:]')"
|
|
103
|
+
[ -z "${FULL_HASH}" ] && continue
|
|
100
104
|
SUBJECT="$(printf '%s' "${SUBJECT}" | sed -E 's/^[[:space:]]+|[[:space:]]+$//g')"
|
|
101
105
|
[ -z "${SUBJECT}" ] && continue
|
|
102
106
|
|
|
@@ -127,54 +131,89 @@ jobs:
|
|
|
127
131
|
if [ -z "${CLEAN_SUBJECT}" ]; then
|
|
128
132
|
CLEAN_SUBJECT="${SUBJECT}"
|
|
129
133
|
fi
|
|
134
|
+
CLEAN_SUBJECT="$(printf '%s' "${CLEAN_SUBJECT}" \
|
|
135
|
+
| tr '\r\n' ' ' \
|
|
136
|
+
| sed -E 's/[[:space:]]+/ /g; s/^[[:space:]]+|[[:space:]]+$//g')"
|
|
137
|
+
|
|
138
|
+
ISSUE_INFO="$(printf '%s\n%s\n' "${SUBJECT}" "${BODY}" \
|
|
139
|
+
| perl -ne 'while(/(?:^|[^A-Za-z0-9_])#([0-9]+)\b/g){print "#$1\n"}' \
|
|
140
|
+
| awk '!seen[$0]++' \
|
|
141
|
+
| paste -sd ' ' -)"
|
|
142
|
+
ISSUE_SUFFIX=""
|
|
143
|
+
if [ -n "${ISSUE_INFO}" ]; then
|
|
144
|
+
ISSUE_SUFFIX=" ${ISSUE_INFO}"
|
|
145
|
+
fi
|
|
130
146
|
|
|
131
147
|
SHORT_HASH="$(printf '%s' "${FULL_HASH}" | cut -c1-7)"
|
|
132
|
-
printf -- '- %s ([%s](%s/commit/%s))\n'
|
|
133
|
-
|
|
148
|
+
printf -- '- %s ([commit %s](%s/commit/%s))%s\n' \
|
|
149
|
+
"${CLEAN_SUBJECT}" \
|
|
150
|
+
"${SHORT_HASH}" \
|
|
151
|
+
"${REPO_URL}" \
|
|
152
|
+
"${FULL_HASH}" \
|
|
153
|
+
"${ISSUE_SUFFIX}" >> "${TARGET_FILE}"
|
|
154
|
+
|
|
155
|
+
BODY_CLEAN="$(printf '%s\n' "${BODY}" \
|
|
156
|
+
| sed 's/\r$//' \
|
|
157
|
+
| sed -E 's/^[[:space:]]+|[[:space:]]+$//g' \
|
|
158
|
+
| sed '/^[[:space:]]*$/d')"
|
|
159
|
+
|
|
160
|
+
if [ -n "${BODY_CLEAN}" ]; then
|
|
161
|
+
while IFS= read -r BODY_LINE; do
|
|
162
|
+
[ -z "${BODY_LINE}" ] && continue
|
|
163
|
+
BODY_LINE="$(printf '%s' "${BODY_LINE}" \
|
|
164
|
+
| tr '\r\n' ' ' \
|
|
165
|
+
| sed -E 's/[[:space:]]+/ /g; s/^[[:space:]]+|[[:space:]]+$//g')"
|
|
166
|
+
[ -z "${BODY_LINE}" ] && continue
|
|
167
|
+
if printf '%s' "${BODY_LINE}" | grep -Eiq '^(re|ref|refs|close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)[:[:space:]]*(#[0-9]+([,[:space:]]+#[0-9]+)*)$'; then
|
|
168
|
+
continue
|
|
169
|
+
fi
|
|
170
|
+
if printf '%s' "${BODY_LINE}" | grep -Eq '^(issues?:)?[[:space:]]*(#[0-9]+([,[:space:]]+#[0-9]+)*)$'; then
|
|
171
|
+
continue
|
|
172
|
+
fi
|
|
173
|
+
if printf '%s' "${BODY_LINE}" | grep -Eiq '^BREAKING[[:space:]]+CHANGE:'; then
|
|
174
|
+
printf ' - **%s**\n' "${BODY_LINE}" >> "${TARGET_FILE}"
|
|
175
|
+
else
|
|
176
|
+
printf ' - %s\n' "${BODY_LINE}" >> "${TARGET_FILE}"
|
|
177
|
+
fi
|
|
178
|
+
done <<< "${BODY_CLEAN}"
|
|
179
|
+
fi
|
|
180
|
+
|
|
181
|
+
printf '\n' >> "${TARGET_FILE}"
|
|
182
|
+
done < <(git log -z "${RANGE}" --no-merges --format='%H%x00%s%x00%b%x00' || true)
|
|
134
183
|
|
|
135
184
|
write_section() {
|
|
136
185
|
local title="$1"
|
|
137
186
|
local file="$2"
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
cat "${file}"
|
|
141
|
-
else
|
|
142
|
-
printf -- '- None\n'
|
|
187
|
+
if [ ! -s "${file}" ]; then
|
|
188
|
+
return 1
|
|
143
189
|
fi
|
|
190
|
+
printf '### %s\n\n' "${title}"
|
|
191
|
+
cat "${file}"
|
|
144
192
|
printf '\n'
|
|
193
|
+
return 0
|
|
145
194
|
}
|
|
146
195
|
|
|
147
196
|
{
|
|
148
197
|
printf '## %s (%s)\n\n' "${DISPLAY_VERSION}" "${DATE}"
|
|
149
|
-
write_section 'Features' "${FEATURES_FILE}"
|
|
150
|
-
write_section 'Refactors' "${REFACTORS_FILE}"
|
|
151
|
-
write_section 'Fixed Bugs' "${FIXES_FILE}"
|
|
152
|
-
write_section 'Others' "${OTHERS_FILE}"
|
|
198
|
+
write_section 'Features' "${FEATURES_FILE}" || true
|
|
199
|
+
write_section 'Refactors' "${REFACTORS_FILE}" || true
|
|
200
|
+
write_section 'Fixed Bugs' "${FIXES_FILE}" || true
|
|
201
|
+
write_section 'Others' "${OTHERS_FILE}" || true
|
|
153
202
|
printf '**Full Changelog**: [%s...%s](%s)\n\n' "${COMPARE_FROM}" "${TAG_NAME}" "${COMPARE_URL}"
|
|
154
203
|
printf -- '---\n'
|
|
155
204
|
} > /tmp/release-entry.md
|
|
156
205
|
|
|
157
206
|
grep -vF "${MARKER}" CHANGELOG.md \
|
|
158
207
|
| sed '/^# Changelog$/d; /^All notable changes to this project will be documented in this file\.$/d' \
|
|
159
|
-
> /tmp/changelog-
|
|
160
|
-
|
|
161
|
-
FIRST_SECTION_LINE="$(grep -n '^## ' /tmp/changelog-base.md | head -n1 | cut -d: -f1 || true)"
|
|
162
|
-
|
|
163
|
-
if [ -n "${FIRST_SECTION_LINE}" ]; then
|
|
164
|
-
head -n "$((FIRST_SECTION_LINE - 1))" /tmp/changelog-base.md > /tmp/changelog-prefix.md
|
|
165
|
-
tail -n "+${FIRST_SECTION_LINE}" /tmp/changelog-base.md > /tmp/changelog-sections.md
|
|
166
|
-
else
|
|
167
|
-
cp /tmp/changelog-base.md /tmp/changelog-prefix.md
|
|
168
|
-
: > /tmp/changelog-sections.md
|
|
169
|
-
fi
|
|
208
|
+
> /tmp/changelog-existing.raw.md || true
|
|
209
|
+
sed '/./,$!d' /tmp/changelog-existing.raw.md > /tmp/changelog-existing.md
|
|
170
210
|
|
|
171
211
|
{
|
|
172
|
-
|
|
173
|
-
printf '\n%s\n\n' "${MARKER}"
|
|
212
|
+
printf '%s\n\n' "${MARKER}"
|
|
174
213
|
cat /tmp/release-entry.md
|
|
175
|
-
if [ -s /tmp/changelog-
|
|
214
|
+
if [ -s /tmp/changelog-existing.md ]; then
|
|
176
215
|
printf '\n'
|
|
177
|
-
cat /tmp/changelog-
|
|
216
|
+
cat /tmp/changelog-existing.md
|
|
178
217
|
fi
|
|
179
218
|
} > /tmp/CHANGELOG.md
|
|
180
219
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,46 @@
|
|
|
1
|
+
## 0.7.1 (2026-03-01)
|
|
1
2
|
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- 简短的介绍 ([
|
|
6
|
+
19236c5](https://github.com/imzbf/github-action-test/commit/
|
|
7
|
+
19236c5852bfb9e69fdbe5df23aa6123c228977c))
|
|
8
|
+
比较长的说明
|
|
9
|
+
BREAKING CHANGE: 不兼容的内容
|
|
10
|
+
re #2
|
|
11
|
+
|
|
12
|
+
### Others
|
|
2
13
|
|
|
14
|
+
- ci: cHANGELOG 现在会记录 commit 正文 ([
|
|
15
|
+
ab2bbab](https://github.com/imzbf/github-action-test/commit/
|
|
16
|
+
ab2bbabfe240ea3a377586f4701f63dba8e907d2))
|
|
17
|
+
re #3
|
|
3
18
|
|
|
19
|
+
**Full Changelog**: [v0.6.0...v0.7.1](https://github.com/imzbf/github-action-test/compare/v0.6.0...v0.7.1)
|
|
4
20
|
|
|
21
|
+
---
|
|
5
22
|
|
|
23
|
+
## 0.6.0 (2026-03-01)
|
|
6
24
|
|
|
25
|
+
### Features
|
|
7
26
|
|
|
8
|
-
|
|
27
|
+
- None
|
|
28
|
+
|
|
29
|
+
### Refactors
|
|
30
|
+
|
|
31
|
+
- None
|
|
32
|
+
|
|
33
|
+
### Fixed Bugs
|
|
34
|
+
|
|
35
|
+
- None
|
|
36
|
+
|
|
37
|
+
### Others
|
|
38
|
+
|
|
39
|
+
- ci: 移除多余的issue入口 ([545e99b](https://github.com/imzbf/github-action-test/commit/545e99b6dc9e7d7ca68dc6b43dd6b8d53c4cca29))
|
|
40
|
+
|
|
41
|
+
**Full Changelog**: [v0.5.2...v0.6.0](https://github.com/imzbf/github-action-test/compare/v0.5.2...v0.6.0)
|
|
42
|
+
|
|
43
|
+
---
|
|
9
44
|
|
|
10
45
|
## 0.5.2 (2026-03-01)
|
|
11
46
|
|
package/package.json
CHANGED
package/src/main.jsx
CHANGED