Skip to content

Split master CHANGELOG.md to each minor version #47

Split master CHANGELOG.md to each minor version

Split master CHANGELOG.md to each minor version #47

name: Split master CHANGELOG.md to each minor version
on:
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
split_changelog:
runs-on: ubuntu-latest
steps:
- name: "Setup NodeJS"
uses: actions/setup-node@v4
with:
node-version: 18
- name: "Checkout fluentui-charting-contrib"
uses: actions/checkout@v4
with:
path: "repo"
- name: Check git config
run: |
cd ./repo
git remote -v
- name: "Create Splits of CHANGELOG and move to docs"
run: |
node ./repo/apps/docsite/src/scripts/splitChangelog.ts
cd ./repo/docs
rm -rf ./changelogSplits
mkdir ./changelogSplits
mv -f ./../../dist/* ./changelogSplits
- name: Get current timestamp
id: timestamp
run: |
echo "::set-output name=timestamp::$(date +%Y%m%d%H%M%S)"
echo "::set-output name=displayTimestamp::$(date +%Y-%m-%d\ %H:%M:%S)"
- name: Commit changes to repo
id: auto-commit-action
uses: stefanzweifel/git-auto-commit-action@v5
with:
repository: repo
branch: changelog-${{ steps.timestamp.outputs.timestamp }}
create_branch: true
commit_message: Changelog update on ${{ steps.timestamp.outputs.displayTimestamp }}
- name: Store new branch name
run: |
cd ./repo
echo "CURRENT_BRANCH=$(git branch --show-current)" >> $GITHUB_ENV
- name: "Send Notification regarding changes"
uses: hunghg255/action-notifications@master
if: steps.auto-commit-action.outputs.changes_detected == 'true'
with:
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: "Changelog changes detected !!"
description: "Create a pull request using this link: https://www.github.com/microsoft/fluentui-charting-contrib/pull/new/${{ env.CURRENT_BRANCH }}"