feat(setup-git): add setup-git action and changelog utility scripts#12
Open
GoogilyBoogily wants to merge 1 commit into
Open
feat(setup-git): add setup-git action and changelog utility scripts#12GoogilyBoogily wants to merge 1 commit into
GoogilyBoogily wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds reusable GitHub Actions utilities to reduce duplication in upcoming workflow/action updates (git identity setup, changelog validation, and release notes extraction).
Changes:
- Added a new composite action
actions/setup-gitto configuregit user.name/git user.email. - Added TypeScript utilities to validate presence of a
## UNRELEASEDsection and extract release notes fromCHANGELOG.md. - Committed the compiled
dist/JavaScript outputs for the new scripts.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
actions/setup-git/action.yml |
New composite action for configuring git identity for automated commits. |
src/validate-changelog.ts |
Adds changelog validation utility (expects ## UNRELEASED). |
src/extract-release-notes.ts |
Adds release notes extraction utility (content between first two ## headers). |
dist/validate-changelog.js |
Compiled JS output for validate-changelog. |
dist/extract-release-notes.js |
Compiled JS output for extract-release-notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+17
to
+21
| - name: "Configure git identity" | ||
| run: | | ||
| git config user.name '${{ inputs.user-name }}' | ||
| git config user.email '${{ inputs.user-email }}' | ||
| shell: bash |
| user-email: | ||
| description: "Git user.email" | ||
| required: false | ||
| default: "41898282+github-actions[bot]@users.noreply.github.com" |
Comment on lines
+4
to
+8
| const changelog = readFileSync('CHANGELOG.md', 'utf8'); | ||
|
|
||
| if (!/^## UNRELEASED/im.test(changelog)) { | ||
| core.setFailed('UNRELEASED section not found in CHANGELOG.md'); | ||
| } |
Comment on lines
+6
to
+12
| const firstHeader = lines.findIndex((line) => /^## /.test(line)); | ||
| const secondHeader = lines.findIndex((line, index) => index > firstHeader && /^## /.test(line)); | ||
|
|
||
| const notes = lines | ||
| .slice(firstHeader + 1, secondHeader === -1 ? undefined : secondHeader) | ||
| .join('\n') | ||
| .trim(); |
1e700e9 to
c7d5c5f
Compare
74339ff to
3b4827f
Compare
3b4827f to
e6d2b33
Compare
c7d5c5f to
d9ddd86
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds shared utilities used by the
version-bumpandrelease-notesactions in subsequent PRs.actions/setup-git/action.yml: composite action that configuresgit user.nameandgit user.emailfor automated commits. Removes the duplicated git config lines fromversion-bump.src/validate-changelog.ts: checksCHANGELOG.mdfor a## UNRELEASEDsection;core.setFailedif missing.src/extract-release-notes.ts: parsesCHANGELOG.mdand outputs the content between the first two##headers asrelease_details. Replaces the awk/heredoc pattern used inrelease-notes.No wiring to callers yet — this PR is purely additive.
Test plan
npm run buildproducesdist/validate-changelog.jsanddist/extract-release-notes.jsvalidate-scriptsCI passes