chore: update changelog #118
Workflow file for this run
This file contains 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
on: | |
pull_request_target: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
branches: | |
- main | |
jobs: | |
check-changelog-updates: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Check for changelog | |
id: check-changelog | |
run: | | |
echo "count=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep -c '^CHANGELOG.md$')" >> $GITHUB_OUTPUT | |
- name: Set comment body | |
id: comment-body | |
run: | | |
if ${{ steps.check-changelog.outputs.count == 0 }}; then | |
echo "content=❗ **CHANGELOG.md** has not been updated." >> $GITHUB_OUTPUT | |
else | |
echo "content=👍 Updated **CHANGELOG.md** found." >> $GITHUB_OUTPUT | |
fi | |
- uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }} | |
script: | | |
await github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: '${{ steps.comment-body.outputs.content }}' | |
}) |