Skip to content

Commit

Permalink
Feat(ci): Auto changelog with PR title instead (dymensionxyz#734)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
hoangdv2429 and github-actions authored May 6, 2024
1 parent b004f7a commit cd66dfd
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 28 deletions.
54 changes: 26 additions & 28 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -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 '[email protected]'
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."
1 change: 1 addition & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGELOG.md
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit cd66dfd

Please sign in to comment.