Revert "Bot to remind of change note (#9407)"

This reverts commit 845f988ab0.
This commit is contained in:
Jeremy Ruston 2025-11-11 09:19:57 +00:00
parent 0bbe170cf0
commit 2d2ba61949
2 changed files with 0 additions and 494 deletions

View file

@ -1,187 +0,0 @@
name: Validate Change Notes
on:
pull_request_target:
types: [opened, reopened, synchronize]
permissions:
contents: read
pull-requests: write
issues: write
jobs:
validate-changenotes:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Checkout base branch
run: |
git fetch origin ${{ github.base_ref }}
- name: Get all changed files in PR
id: all-files
uses: tj-actions/changed-files@v47
with:
base_sha: ${{ github.event.pull_request.base.sha }}
- name: Get changed note files
id: changed-files
uses: tj-actions/changed-files@v47
with:
files: |
editions/*/tiddlers/releasenotes/**/*.tid
base_sha: ${{ github.event.pull_request.base.sha }}
- name: Check if PR needs change notes
id: check-needs-notes
run: |
chmod +x bin/changenote.sh
if bin/changenote.sh check-needs ${{ steps.all-files.outputs.all_changed_files }}; then
echo "needs_note=true" >> $GITHUB_OUTPUT
else
echo "needs_note=false" >> $GITHUB_OUTPUT
fi
echo "has_notes=${{ steps.changed-files.outputs.any_changed }}" >> $GITHUB_OUTPUT
shell: bash
- name: Validate change note format
if: steps.changed-files.outputs.any_changed == 'true'
id: validate
continue-on-error: true
run: |
chmod +x bin/changenote.sh
if bin/changenote.sh validate ${{ steps.changed-files.outputs.all_changed_files }}; then
echo "result=success" >> $GITHUB_OUTPUT
else
echo "result=failure" >> $GITHUB_OUTPUT
# Save error details if they exist
if [ -f /tmp/validation_errors.md ]; then
{
echo 'errors<<EOF'
cat /tmp/validation_errors.md
echo EOF
} >> $GITHUB_OUTPUT
fi
exit 1
fi
shell: bash
- name: Parse change note summaries
if: steps.changed-files.outputs.any_changed == 'true' && steps.validate.outcome == 'success'
id: parse-notes
run: |
chmod +x bin/changenote.sh
summaries=$(bin/changenote.sh parse ${{ steps.changed-files.outputs.all_changed_files }})
{
echo 'summaries<<EOF'
echo "$summaries"
echo EOF
} >> $GITHUB_OUTPUT
shell: bash
- name: Find existing bot comment
if: always()
uses: peter-evans/find-comment@v3
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: 'Change Note Status'
- name: Create or update comment (validation passed)
if: steps.changed-files.outputs.any_changed == 'true' && steps.validate.outcome == 'success'
uses: peter-evans/create-or-update-comment@v5
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
## ✅ Change Note Status
All change notes are properly formatted and validated!
${{ steps.parse-notes.outputs.summaries }}
<details>
<summary>📖 Change Note Guidelines</summary>
Change notes help track and communicate changes effectively. See the [full documentation](https://tiddlywiki.com/prerelease/#Release%20Notes%20and%20Changes) for details.
</details>
- name: Create or update comment (validation failed)
if: steps.changed-files.outputs.any_changed == 'true' && steps.validate.outcome == 'failure'
uses: peter-evans/create-or-update-comment@v5
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
## ❌ Change Note Status
Change note validation failed. Please fix the following issues:
${{ steps.validate.outputs.errors }}
---
[Release Notes and Changes](https://tiddlywiki.com/prerelease/#Release%20Notes%20and%20Changes)
- name: Create or update comment (missing change note)
if: steps.check-needs-notes.outputs.needs_note == 'true' && steps.changed-files.outputs.any_changed != 'true'
uses: peter-evans/create-or-update-comment@v5
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
## ⚠️ Change Note Status
This PR appears to contain code changes but doesn't include a change note.
Please add a change note by creating a `.tid` file in `editions/tw5.com/tiddlers/releasenotes/<version>/` with the following format:
[Release Notes and Changes](https://tiddlywiki.com/prerelease/#Release%20Notes%20and%20Changes)
Note: If this is a documentation-only change or doesn't require a change note, you can ignore this message.
- name: Create or update comment (doc only - has no notes)
if: steps.check-needs-notes.outputs.needs_note == 'false' && steps.changed-files.outputs.any_changed != 'true'
uses: peter-evans/create-or-update-comment@v5
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
## ✅ Change Note Status
This PR contains documentation or configuration changes that typically don't require a change note.
- name: Remove comment if not needed
if: steps.check-needs-notes.outputs.needs_note == 'false' && steps.changed-files.outputs.any_changed == 'true'
uses: peter-evans/create-or-update-comment@v5
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
## ✅ Change Note Status
This PR contains documentation or configuration changes that typically don't require a change note.
- name: Fail workflow if validation failed
if: steps.validate.outcome == 'failure'
run: |
echo "::error::Change note validation failed. Please check the PR comment for details."
exit 1