feat(pause): add pausedAt timestamp to manual pause command #70
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Changelog | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| update-changelog: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| - name: Get latest commit details | |
| id: last_commit | |
| run: | | |
| COMMIT_HASH=$(git log -1 --pretty=format:'%H') | |
| COMMIT_DATE=$(git log -1 --pretty=format:'%ad' --date=format:'%Y-%m-%d') | |
| COMMIT_MSG=$(git log -1 --pretty=format:"%s") | |
| COMMIT_AUTHOR=$(git log -1 --pretty=format:"%an") | |
| echo "hash=$COMMIT_HASH" >> $GITHUB_OUTPUT | |
| echo "date=$COMMIT_DATE" >> $GITHUB_OUTPUT | |
| echo "msg=$COMMIT_MSG" >> $GITHUB_OUTPUT | |
| echo "author=$COMMIT_AUTHOR" >> $GITHUB_OUTPUT | |
| - name: Append commit to CHANGELOG.md | |
| run: | | |
| HASH="${{ steps.last_commit.outputs.hash }}" | |
| DATE="${{ steps.last_commit.outputs.date }}" | |
| MSG="${{ steps.last_commit.outputs.msg }}" | |
| AUTHOR="${{ steps.last_commit.outputs.author }}" | |
| SHORT_HASH=$(echo "$HASH" | cut -c1-7) | |
| # Format line | |
| ENTRY="- \`${MSG}\` ([\`${SHORT_HASH}\`](https://github.com/${{ github.repository }}/commit/${HASH})) by **${AUTHOR}**" | |
| # Insert under existing date or create new section | |
| if grep -q "### 📅 ${DATE}" CHANGELOG.md; then | |
| sed -i "/### 📅 ${DATE}/a ${ENTRY}" CHANGELOG.md | |
| else | |
| echo -e "\n---\n\n### 📅 ${DATE}\n${ENTRY}" >> CHANGELOG.md | |
| fi | |
| - name: Commit and push changes | |
| run: | | |
| git add CHANGELOG.md | |
| git commit -m "docs(changelog): update for latest commit" | |
| git push |