mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Update changelog update workflow
Fix sed command to append entries in CHANGELOG.md
This commit is contained in:
35
.github/workflows/add_PR_2_chlog.yml
vendored
Normal file
35
.github/workflows/add_PR_2_chlog.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
name: Update Changelog for Renovate PR
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize]
|
||||
branches:
|
||||
- dev # or your target branch
|
||||
|
||||
jobs:
|
||||
update-changelog:
|
||||
if: github.actor == 'renovate[bot]' # Only run for Renovate PRs
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Extract PR title
|
||||
id: pr_title
|
||||
run: echo "title=${{ github.event.pull_request.title }}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Update CHANGELOG.md
|
||||
run: |
|
||||
TITLE="${{ steps.pr_title.outputs.title }}"
|
||||
DATE=$(date +'%Y-%m-%d')
|
||||
sed -i "/## \[Dependency update\]/a\\
|
||||
- ${DATE}: ${TITLE}" CHANGELOG.md
|
||||
|
||||
- name: Commit changelog update
|
||||
run: |
|
||||
git config user.name "github-actions"
|
||||
git config user.email "github-actions@github.com"
|
||||
git add CHANGELOG.md
|
||||
git commit -m "docs: update changelog for Renovate PR"
|
||||
git push
|
||||
Reference in New Issue
Block a user