feat: Create release on push#3
Conversation
|
I am now trying to add link to the release page. |
|
Test result (file was deleted for PR): https://github.com/sator-imaging/PRDigest.NET/releases/tag/archives-20260214 |
There was a problem hiding this comment.
Pull request overview
This PR introduces a GitHub Actions workflow that automatically creates releases when markdown files are pushed to the archives directory. The purpose is to enable email notifications for users watching the repository with "All Activity" enabled, which doesn't happen with regular commits.
Changes:
- Added a new workflow that triggers on pushes to
archives/**/*.mdfiles - Generates date-based tags and creates GitHub releases with links to the changed archive files
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| FILE=$(git diff-tree --no-commit-id --name-only -r HEAD | grep "^archives/.*$" | head -n 1) | ||
|
|
||
| if [ -z "$FILE" ]; then | ||
| echo "Error: No archives changes detected" | ||
| exit 1 | ||
| fi | ||
|
|
There was a problem hiding this comment.
Using 'head -n 1' means only the first changed file is included in the release, but if multiple archive files are pushed in a single commit, the other files will be ignored. This could lead to incomplete notifications. Consider either: 1) Creating separate releases for each changed file, 2) Including all changed files in the release notes, or 3) Failing the workflow if multiple files are detected to enforce one file per commit.
| FILE=$(git diff-tree --no-commit-id --name-only -r HEAD | grep "^archives/.*$" | head -n 1) | |
| if [ -z "$FILE" ]; then | |
| echo "Error: No archives changes detected" | |
| exit 1 | |
| fi | |
| FILES=$(git diff-tree --no-commit-id --name-only -r HEAD | grep "^archives/.*$" || true) | |
| if [ -z "$FILES" ]; then | |
| echo "Error: No archives changes detected" | |
| exit 1 | |
| fi | |
| FILE_COUNT=$(printf '%s\n' "$FILES" | wc -l) | |
| if [ "$FILE_COUNT" -ne 1 ]; then | |
| echo "Error: Expected exactly one changed archive file, but found $FILE_COUNT:" | |
| printf '%s\n' "$FILES" | |
| exit 1 | |
| fi | |
| FILE="$FILES" |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@sator-imaging Thank you! Looks good, I'll merge this. |
This PR solves the problem that the email is not sent even if "Watch" is set to "All Activity", by creating release on push to "archives" folder.