@vavt/github-action-test 0.1.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.
@@ -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: |
@@ -63,19 +62,82 @@ jobs:
63
62
  '<!-- next-release -->' > CHANGELOG.md
64
63
  fi
65
64
 
66
- if grep -q "^## ${TAG_NAME} (" CHANGELOG.md; then
65
+ DISPLAY_VERSION="${TAG_NAME#v}"
66
+
67
+ if grep -q "^## ${TAG_NAME} (" CHANGELOG.md || grep -q "^## ${DISPLAY_VERSION} (" CHANGELOG.md; then
67
68
  echo "CHANGELOG already contains ${TAG_NAME}, skip update."
68
69
  exit 0
69
70
  fi
70
71
 
71
- NOTES="$(gh release view "${TAG_NAME}" --json body --jq '.body')"
72
72
  DATE="$(date -u +%Y-%m-%d)"
73
73
  MARKER='<!-- next-release -->'
74
+ REPO_URL="https://github.com/${GITHUB_REPOSITORY}"
75
+
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}"
83
+ fi
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
74
116
 
75
- printf '## %s (%s)\n\n%s\n' \
76
- "${TAG_NAME}" \
77
- "${DATE}" \
78
- "${NOTES}" > /tmp/release-entry.md
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
+
133
+ {
134
+ printf '## %s (%s)\n\n' "${DISPLAY_VERSION}" "${DATE}"
135
+ printf -- '---\n\n'
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}"
140
+ } > /tmp/release-entry.md
79
141
 
80
142
  grep -vF "${MARKER}" CHANGELOG.md > /tmp/changelog-base.md || true
81
143
 
package/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+
6
+
7
+
8
+ <!-- next-release -->
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
+
19
+ ## v0.1.0 (2026-02-28)
20
+
21
+ <!-- Release notes generated using configuration in .github/release.yml at v0.1.0 -->
22
+
23
+
24
+
25
+ **Full Changelog**: https://github.com/imzbf/github-action-test/compare/v0.0.5...v0.1.0
26
+
5
27
  ## v0.0.3 (2026-02-28)
6
28
 
7
29
  <!-- Release notes generated using configuration in .github/release.yml at v0.0.3 -->
@@ -26,4 +48,3 @@ All notable changes to this project will be documented in this file.
26
48
 
27
49
  **Full Changelog**: https://github.com/imzbf/github-action-test/compare/v0.0.4...v0.0.5
28
50
 
29
- <!-- next-release -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vavt/github-action-test",
3
- "version": "0.1.0",
3
+ "version": "0.3.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! 022404');
3
3
  };
4
4
 
5
5
  hello();