From cd66dfd0357efbb9f293c0b737b605f467ff3ac1 Mon Sep 17 00:00:00 2001 From: Hoang Do Date: Mon, 6 May 2024 13:19:36 +0700 Subject: [PATCH] Feat(ci): Auto changelog with PR title instead (#734) Co-authored-by: github-actions --- .github/workflows/changelog.yml | 54 ++++++++++++++++----------------- .markdownlintignore | 1 + CHANGELOG.md | 6 ++++ 3 files changed, 33 insertions(+), 28 deletions(-) create mode 100644 .markdownlintignore diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 5a9a002b5..9141445ab 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,44 +1,42 @@ -# This workflow will add a changelog to the repository when a new commit is pushed to the main branch. -# E.g., manually edit the commit message to align with conventional commit messages, such as: -# feat(database): add new indexing capabilities -# This update introduces advanced indexing options for handling complex queries more efficiently. - -name: Changelog Update +name: Auto Changelog Update on: - pull_request: + push: branches: - main - types: [opened, synchronize, reopened] - -permissions: write-all jobs: update_changelog: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 + - name: Checkout the repository + uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Set up Node.js - uses: actions/setup-node@v2 + - name: Setup Node.js + uses: actions/setup-node@v3 with: - node-version: "18" - - - name: Install conventional-changelog-cli - run: npm install -g conventional-changelog-cli + node-version: '18' - - name: Generate changelog diff + - name: Generate Changelog Update run: | - git fetch origin main:main - conventional-changelog -p angular -i CHANGELOG.md -s -r 0 > changelog_diff.md - echo "::set-output name=changelog::$(cat changelog_diff.md)" - - name: Commit and push changelog update + # Example: Using conventional-changelog to update CHANGELOG.md + npm install -g conventional-changelog-cli + conventional-changelog -p angular -i CHANGELOG.md -s + + - name: Create or Update Pull Request + id: cpr + uses: peter-evans/create-pull-request@v4 + with: + commit-message: "Update CHANGELOG.md [skip ci]" + title: "Automated Changelog Update [skip ci]" + body: "Update the CHANGELOG.md with recent pushs. [skip ci]" + branch: auto-changelog-update-${{ github.run_number }} + delete-branch: true + branch-suffix: timestamp + + - name: Check if PR needs to be updated + if: steps.cpr.outputs.pull-request-operation == 'updated' run: | - git config user.name 'github-actions' - git config user.email 'github-actions@github.com' - git add CHANGELOG.md - git commit -m "Update CHANGELOG.md" - git push origin HEAD:refs/heads/${{ github.head_ref }} + echo "Changelog PR updated due to new commit to main." diff --git a/.markdownlintignore b/.markdownlintignore new file mode 100644 index 000000000..83b694704 --- /dev/null +++ b/.markdownlintignore @@ -0,0 +1 @@ +CHANGELOG.md \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a4a36a1a..6d620c5f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # [](https://github.com/dymensionxyz/dymint/compare/v1.1.0-rc02...v) (2024-05-05) + ### Bug Fixes * **bug:** sync from da and p2p when starting a node ([#763](https://github.com/dymensionxyz/dymint/issues/763)) ([68ffd05](https://github.com/dymensionxyz/dymint/commit/68ffd05794949ddc42df1c132d1fde5f21b505f4)) @@ -28,6 +29,11 @@ * **produce:** limiting block size by maxBatchSize ([#784](https://github.com/dymensionxyz/dymint/issues/784)) ([f90042c](https://github.com/dymensionxyz/dymint/commit/f90042cd61fc6b60093478cd65491f8aa1106457)) +### Features + +* **ci:** changelog workflow ([c096f2f](https://github.com/dymensionxyz/dymint/commit/c096f2f5196e5cbcba8ff81097d8bad7534c46ae)) + + # [1.1.0-rc02](https://github.com/dymensionxyz/dymint/compare/v1.1.0-rc01...v1.1.0-rc02) (2024-04-26)