@vavt/github-action-test 0.2.0 → 0.3.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.
- package/.github/workflows/latest.yml +60 -42
- package/CHANGELOG.md +11 -0
- package/package.json +1 -1
- package/src/main.jsx +1 -1
|
@@ -50,7 +50,6 @@ jobs:
|
|
|
50
50
|
- name: Update CHANGELOG.md
|
|
51
51
|
continue-on-error: true
|
|
52
52
|
env:
|
|
53
|
-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
54
53
|
TAG_NAME: ${{ github.ref_name }}
|
|
55
54
|
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
|
|
56
55
|
run: |
|
|
@@ -70,55 +69,74 @@ jobs:
|
|
|
70
69
|
exit 0
|
|
71
70
|
fi
|
|
72
71
|
|
|
73
|
-
NOTES="$(gh release view "${TAG_NAME}" --json body --jq '.body')"
|
|
74
72
|
DATE="$(date -u +%Y-%m-%d)"
|
|
75
73
|
MARKER='<!-- next-release -->'
|
|
74
|
+
REPO_URL="https://github.com/${GITHUB_REPOSITORY}"
|
|
76
75
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
/tmp/release-notes.raw.md > /tmp/release-notes.cleaned.md
|
|
85
|
-
|
|
86
|
-
awk '
|
|
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
|
|
76
|
+
PREV_TAG="$(git tag --list 'v*' --sort=-creatordate | grep -Fxv "${TAG_NAME}" | head -n1 || true)"
|
|
77
|
+
|
|
78
|
+
if [ -n "${PREV_TAG}" ]; then
|
|
79
|
+
RANGE="${PREV_TAG}..${TAG_NAME}"
|
|
80
|
+
else
|
|
81
|
+
ROOT_COMMIT="$(git rev-list --max-parents=0 "${TAG_NAME}" | tail -n1)"
|
|
82
|
+
RANGE="${ROOT_COMMIT}..${TAG_NAME}"
|
|
115
83
|
fi
|
|
116
84
|
|
|
85
|
+
FEATURES_FILE='/tmp/changelog-features.md'
|
|
86
|
+
REFACTORS_FILE='/tmp/changelog-refactors.md'
|
|
87
|
+
FIXES_FILE='/tmp/changelog-fixed-bugs.md'
|
|
88
|
+
OTHERS_FILE='/tmp/changelog-others.md'
|
|
89
|
+
: > "${FEATURES_FILE}"
|
|
90
|
+
: > "${REFACTORS_FILE}"
|
|
91
|
+
: > "${FIXES_FILE}"
|
|
92
|
+
: > "${OTHERS_FILE}"
|
|
93
|
+
|
|
94
|
+
while IFS=$'\t' read -r FULL_HASH SUBJECT; do
|
|
95
|
+
[ -z "${FULL_HASH:-}" ] && continue
|
|
96
|
+
SUBJECT="$(printf '%s' "${SUBJECT}" | sed -E 's/^[[:space:]]+|[[:space:]]+$//g')"
|
|
97
|
+
[ -z "${SUBJECT}" ] && continue
|
|
98
|
+
|
|
99
|
+
TARGET_FILE="${OTHERS_FILE}"
|
|
100
|
+
CLEAN_SUBJECT="${SUBJECT}"
|
|
101
|
+
|
|
102
|
+
if printf '%s' "${SUBJECT}" | grep -Eiq '^feat(\([^)]*\))?(!)?:[[:space:]]*'; then
|
|
103
|
+
TARGET_FILE="${FEATURES_FILE}"
|
|
104
|
+
CLEAN_SUBJECT="$(printf '%s' "${SUBJECT}" | sed -E 's/^feat(\([^)]*\))?(!)?:[[:space:]]*//I')"
|
|
105
|
+
elif printf '%s' "${SUBJECT}" | grep -Eiq '^refactor(\([^)]*\))?(!)?:[[:space:]]*'; then
|
|
106
|
+
TARGET_FILE="${REFACTORS_FILE}"
|
|
107
|
+
CLEAN_SUBJECT="$(printf '%s' "${SUBJECT}" | sed -E 's/^refactor(\([^)]*\))?(!)?:[[:space:]]*//I')"
|
|
108
|
+
elif printf '%s' "${SUBJECT}" | grep -Eiq '^fix(\([^)]*\))?(!)?:[[:space:]]*'; then
|
|
109
|
+
TARGET_FILE="${FIXES_FILE}"
|
|
110
|
+
CLEAN_SUBJECT="$(printf '%s' "${SUBJECT}" | sed -E 's/^fix(\([^)]*\))?(!)?:[[:space:]]*//I')"
|
|
111
|
+
fi
|
|
112
|
+
|
|
113
|
+
if [ -z "${CLEAN_SUBJECT}" ]; then
|
|
114
|
+
CLEAN_SUBJECT="${SUBJECT}"
|
|
115
|
+
fi
|
|
116
|
+
|
|
117
|
+
SHORT_HASH="$(printf '%s' "${FULL_HASH}" | cut -c1-7)"
|
|
118
|
+
printf -- '- %s ([%s](%s/commit/%s))\n' "${CLEAN_SUBJECT}" "${SHORT_HASH}" "${REPO_URL}" "${FULL_HASH}" >> "${TARGET_FILE}"
|
|
119
|
+
done < <(git log "${RANGE}" --no-merges --format='%H%x09%s' || true)
|
|
120
|
+
|
|
121
|
+
write_section() {
|
|
122
|
+
local title="$1"
|
|
123
|
+
local file="$2"
|
|
124
|
+
printf '### %s\n\n' "${title}"
|
|
125
|
+
if [ -s "${file}" ]; then
|
|
126
|
+
cat "${file}"
|
|
127
|
+
else
|
|
128
|
+
printf -- '- None\n'
|
|
129
|
+
fi
|
|
130
|
+
printf '\n'
|
|
131
|
+
}
|
|
132
|
+
|
|
117
133
|
{
|
|
118
134
|
printf '## %s (%s)\n\n' "${DISPLAY_VERSION}" "${DATE}"
|
|
119
135
|
printf -- '---\n\n'
|
|
120
|
-
|
|
121
|
-
|
|
136
|
+
write_section 'Features' "${FEATURES_FILE}"
|
|
137
|
+
write_section 'Refactors' "${REFACTORS_FILE}"
|
|
138
|
+
write_section 'Fixed Bugs' "${FIXES_FILE}"
|
|
139
|
+
write_section 'Others' "${OTHERS_FILE}"
|
|
122
140
|
} > /tmp/release-entry.md
|
|
123
141
|
|
|
124
142
|
grep -vF "${MARKER}" CHANGELOG.md > /tmp/changelog-base.md || true
|
package/CHANGELOG.md
CHANGED
|
@@ -3,8 +3,19 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
|
|
7
|
+
|
|
6
8
|
<!-- next-release -->
|
|
7
9
|
|
|
10
|
+
## 0.2.0 (2026-02-28)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
### Changes
|
|
15
|
+
|
|
16
|
+
<!-- Release notes generated using configuration in .github/release.yml at v0.2.0 -->
|
|
17
|
+
|
|
18
|
+
|
|
8
19
|
## v0.1.0 (2026-02-28)
|
|
9
20
|
|
|
10
21
|
<!-- Release notes generated using configuration in .github/release.yml at v0.1.0 -->
|
package/package.json
CHANGED
package/src/main.jsx
CHANGED