From 09aaadc282134358ba71e977af80c5560bb6ae89 Mon Sep 17 00:00:00 2001 From: Gita Alekhya Paul <54375111+gitaalekhyapaul@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:32:41 +0530 Subject: [PATCH] feat: changelog automation Signed-off-by: Gita Alekhya Paul <54375111+gitaalekhyapaul@users.noreply.github.com> --- .github/changelog-config.yml | 22 +++++++++++++++++++++ .github/workflows/changelog.yml | 34 +++++++++++++++++++++++++++++++++ README.md | 18 +++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 .github/changelog-config.yml create mode 100644 .github/workflows/changelog.yml diff --git a/.github/changelog-config.yml b/.github/changelog-config.yml new file mode 100644 index 0000000..40a5c65 --- /dev/null +++ b/.github/changelog-config.yml @@ -0,0 +1,22 @@ +changelog: + exclude: + labels: + - ignore-for-release + authors: + - dependabot + categories: + - title: 🚀 Features + labels: + - enhancement + - feature + - title: 🐛 Bug Fixes + labels: + - bug + - fix + - title: 🧰 Maintenance + labels: + - chore + - dependencies + - title: 📝 Documentation + labels: + - documentation diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 0000000..b335314 --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,34 @@ +name: Generate Changelog + +on: + release: + types: [created] + +jobs: + generate-changelog: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Generate Changelog + run: | + # Install github-changelog-generator if not using container + gem install github_changelog_generator + + # Generate changelog + github_changelog_generator \ + -u ${{ github.repository_owner }} \ + -p ${{ github.event.repository.name }} \ + --token ${{ secrets.GITHUB_TOKEN }} \ + --since-tag $(git describe --tags --abbrev=0 `git rev-list --tags --skip=1 --max-count=1`) \ + --future-release ${{ github.event.release.tag_name }} + + - name: Commit and Push Changelog + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add CHANGELOG.md + git commit -m "docs: update changelog for ${{ github.event.release.tag_name }}" + git push diff --git a/README.md b/README.md index 9da0ed9..3967274 100644 --- a/README.md +++ b/README.md @@ -350,3 +350,21 @@ TOKEN_DETAILS_PATH=token.jsonc - Express.js: https://expressjs.com/ ⚡ - Tailwind CSS: https://tailwindcss.com/docs 💅 - TypeScript: https://www.typescriptlang.org/docs/ 📘 + +## 📝 Contributing + +### Commit Message Format + +Follow these commit message guidelines to automate changelog generation: + +- `feat: add new feature` - New features (generates under 🚀 Features) +- `fix: resolve bug` - Bug fixes (generates under 🐛 Bug Fixes) +- `docs: update readme` - Documentation changes (generates under 📝 Documentation) +- `chore: update deps` - Maintenance (generates under 🧰 Maintenance) + +Example: + +```bash +git commit -m "feat: add OAuth support for Discord" +git commit -m "fix: resolve token validation issue" +```