Skip to content

Commit 9737dc9

Browse files
committedOct 18, 2024
docs: update README with details on markdown link conversion and other features
1 parent 26399c6 commit 9737dc9

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed
 

‎README.md

+19-12
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,24 @@ A GitHub Action that sends a stylized Discord webhook containing the description
44

55
## Features
66

7-
- Formats release descriptions by:
8-
- Removing carriage returns and HTML comments.
9-
- Styling headers for better readability in Discord (optional).
10-
- Cleaning up redundant whitespace and newlines.
11-
- Converting common GitHub links (e.g., PRs, Issues) into clickable URLs.
12-
- Limits description length to avoid exceeding Discord's character limits.
13-
- Provides customization for the Discord message, including:
14-
- Webhook URL, message color, footer text/icon, and timestamp.
15-
- Username and avatar for the webhook.
16-
- Optional message content outside the embed.
7+
- **Text Cleanup:**
8+
- **Carriage Return Removal:** Automatically removes carriage return characters for clean formatting.
9+
- **HTML Comment Stripping:** Eliminates HTML comments to remove unnecessary information.
10+
- **Whitespace Optimization:** Reduces redundant newlines and excess spaces while preserving proper paragraph spacing.
11+
- **Mention Conversion:** Converts GitHub mentions (e.g., `@username`) into clickable GitHub profile links for easy navigation.
12+
- **Markdown Link Conversion:**
13+
- **PR Links:** Converts pull request URLs into Markdown links (e.g., `[PR #1](https://github.com/OWNER/REPO/pull/1)`).
14+
- **Issue Links:** Converts issue URLs into Markdown links (e.g., `[Issue #1](https://github.com/OWNER/REPO/issues/1)`).
15+
- **Changelog Links:** Converts changelog comparison URLs into concise Markdown links (e.g., `[v1.0.0...v1.1.0](https://github.com/OWNER/REPO/compare/v1.0.0...v1.1.0)`).
16+
- **Heading Reduction (Optional):** If enabled, it reduces heading sizes for a cleaner, more compact display:
17+
- H3 headings are converted to bold and underlined.
18+
- H2 headings are converted to bold.
19+
- **Description Length Management:** Ensures the release description fits within Discord's embed message limits (default 4096 characters), trimming excess text by cutting at newlines when possible or adding a continuation link.
20+
- **Custom Embed Appearance:**
21+
- Set a custom color for the Discord embed message.
22+
- Optionally include a custom footer with a title, icon, and a timestamp to make the notification more informative.
23+
- **Error Handling:** Provides clear error messages for any invalid or missing inputs, ensuring that the webhook action does not fail silently.
24+
- **Webhook Delivery:** Sends the formatted message to the specified Discord channel via webhook, ensuring your release notifications are promptly delivered with the correct details.
1725

1826
---
1927

@@ -107,7 +115,6 @@ If you have suggestions for how GitHub Releases To Discord Action could be impro
107115
This file will be used to test the action locally and simulate a real release event webhook payload. Refer to the [GitHub Webhook documentation](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=published#release) and the [Github API Documentation](https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#get-a-release) for more information on the webhook payload structure.
108116

109117
6. Fill the test json file with the necessary fields to simulate a release event.
110-
111118
5. Create a test file called `.env` in the main root of the project with the following environmental variables:
112119

113120
```bash
@@ -125,7 +132,7 @@ This file will be used to test the action locally and simulate a real release ev
125132

126133
8. Fill the `.env` file with your chosen environmental variables values.
127134
9. Create a Discord webhook in your server, making sure to add the webhook url to the `.env` file under `INPUT_WEBHOOK_URL=`.
128-
10. Run the action locally with `act release -e <your.json>` (e.g. `act release -e tests/sample-test-release.json`) and check the output in your Discord server.
135+
10. Run the action locally with `act release -e <your.json>` (e.g., `act release -e tests/sample-test-release.json`) and check the output in your Discord server.
129136
11. Confirm that the action works as expected.
130137
12. Make your changes and commit them: `git commit -m '<commit_message>'`. Please follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
131138
13. Create the pull request.

0 commit comments

Comments
 (0)
Please sign in to comment.