{"id":16171684,"url":"https://github.com/sethcohen/github-releases-to-discord","last_synced_at":"2025-03-19T00:30:46.654Z","repository":{"id":57827696,"uuid":"528230104","full_name":"SethCohen/github-releases-to-discord","owner":"SethCohen","description":"Posts a GitHub Release changelog to a specified Discord channel","archived":false,"fork":false,"pushed_at":"2023-12-14T21:12:05.000Z","size":1233,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-01T22:29:09.523Z","etag":null,"topics":["action","changelog","changelog-parser","discord","discord-webhook","embed","github","github-action","github-actions","github-release","release","webhook"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SethCohen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-08-24T02:02:55.000Z","updated_at":"2024-04-27T07:02:55.000Z","dependencies_parsed_at":"2023-12-11T17:42:58.694Z","dependency_job_id":null,"html_url":"https://github.com/SethCohen/github-releases-to-discord","commit_stats":{"total_commits":55,"total_committers":4,"mean_commits":13.75,"dds":"0.36363636363636365","last_synced_commit":"ba06d833522e55d3453ee27bea9a7f3655378359"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SethCohen%2Fgithub-releases-to-discord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SethCohen%2Fgithub-releases-to-discord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SethCohen%2Fgithub-releases-to-discord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SethCohen%2Fgithub-releases-to-discord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SethCohen","download_url":"https://codeload.github.com/SethCohen/github-releases-to-discord/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243955757,"owners_count":20374373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["action","changelog","changelog-parser","discord","discord-webhook","embed","github","github-action","github-actions","github-release","release","webhook"],"created_at":"2024-10-10T03:43:50.112Z","updated_at":"2025-03-19T00:30:45.574Z","avatar_url":"https://github.com/SethCohen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Releases To Discord Action\n\nA GitHub Action that sends a stylized Discord webhook containing the description of a GitHub Release to a specified Discord channel. It formats the description to improve readability and includes various configuration options to customize the message.\n\n## Features\n\n- **Text Cleanup:**\n  - **Carriage Return Removal:** Automatically removes carriage return characters for clean formatting.\n  - **HTML Comment Stripping:** Eliminates HTML comments to remove unnecessary information.\n  - **Whitespace Optimization:** Reduces redundant newlines and excess spaces while preserving proper paragraph spacing.\n- **Mention Conversion:** Converts GitHub mentions (e.g., `@username`) into clickable GitHub profile links for easy navigation.\n- **Markdown Link Conversion:**\n  - **PR Links:** Converts pull request URLs into Markdown links (e.g., `[PR #1](https://github.com/OWNER/REPO/pull/1)`).\n  - **Issue Links:** Converts issue URLs into Markdown links (e.g., `[Issue #1](https://github.com/OWNER/REPO/issues/1)`).\n  - **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)`).\n- **Heading Reduction (Optional):** If enabled, it reduces heading sizes for a cleaner, more compact display:\n  - H3 headings are converted to bold and underlined.\n  - H2 headings are converted to bold.\n- **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.\n- **Custom Embed Appearance:**\n  - Set a custom color for the Discord embed message.\n  - Optionally include a custom footer with a title, icon, and a timestamp to make the notification more informative.\n- **Error Handling:** Provides clear error messages for any invalid or missing inputs, ensuring that the webhook action does not fail silently.\n- **Webhook Delivery:** Sends the formatted message to the specified Discord channel via webhook, ensuring your release notifications are promptly delivered with the correct details.\n\n---\n\n## Output\n\n![output](https://i.imgur.com/ovr0gTL.png)\n\n## Configuration\n\n| Variable        | Required | Default                                                                                               | Description                                     |\n|-----------------|----------|-------------------------------------------------------------------------------------------------------|-------------------------------------------------|\n| webhook_url     | ✔        |                                                                                                       | Discord's webhook url. Use GH repo secrets.     |\n| color           | ❌       | \"2105893\"                                                                                             | Decimal color value for embed.                  |\n| username        | ❌       |                                                                                                       | String username for webhook.                    |\n| avatar_url      | ❌       |                                                                                                       | String url to webhook avatar picture.           |\n| content         | ❌       |                                                                                                       | String content for webhook.                     |\n| footer_title    | ❌       |                                                                                                       | String title for the webhook footer.            |\n| footer_icon_url | ❌       |                                                                                                       | String url for the webhook footer picture.      |\n| footer_timestamp| ❌       |                                                                                                       | Boolean to enable footer timestamp.             |\n| max_description | ❌       | \"4096\"                                                                                                | Max length for the description.                 |\n| reduce_headings | ❌       | false                                                                                                 | Converts H3 to bold, h2 to bold \u0026 underline.    |\n\n## Example Usage\n\n`.github/workflows/github-releases-to-discord.yml`\n\n```yaml\non:\n  release:\n    types: [published]\n\njobs:\n  github-releases-to-discord:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n      - name: Github Releases To Discord\n        uses: SethCohen/github-releases-to-discord@v1\n        with:\n          webhook_url: ${{ secrets.WEBHOOK_URL }}\n          color: \"2105893\"\n          username: \"Release Changelog\"\n          avatar_url: \"https://cdn.discordapp.com/avatars/487431320314576937/bd64361e4ba6313d561d54e78c9e7171.png\"\n          content: \"||@everyone||\"\n          footer_title: \"Changelog\"\n          footer_icon_url: \"https://cdn.discordapp.com/avatars/487431320314576937/bd64361e4ba6313d561d54e78c9e7171.png\"\n          footer_timestamp: true\n          max_description: '4096'\n          reduce_headings: true\n```\n\n## Setup Instructions\n\n1. Open your **Server Settings** and head into the **Integrations** tab:\n2. Click the \"**Create Webhook**\" button to create a new webhook!\n   ![create webhook](https://support.discord.com/hc/article_attachments/1500000463501/Screen_Shot_2020-12-15_at_4.41.53_PM.png)\n   ![created webhook](https://support.discord.com/hc/article_attachments/360101553853/Screen_Shot_2020-12-15_at_4.51.38_PM.png)\n3. Copy the webhook url\n4. Create a new GitHub repository secret called WEBHOOK_URL and paste the webhook url into it.\n   ![repository secret](https://i.imgur.com/hAaNOds.png)\n5. Save the secret.\n6. Add the secret to your action configuration.\n\nAnd you're done! Whenever you create a new release, the workflow should run and, if properly setup, post to your specified Discord channel.\n\n## Contributing\n\nIf you have suggestions for how GitHub Releases To Discord Action could be improved, or want to report a bug, open an issue! We'd love all and any contributions.\n\n1. Fork the repository.\n2. Install node and run `npm install`.\n3. Install [Github Action tester `act`](https://github.com/nektos/act)\n4. Create a sample test Release file to simulate a webhook payload object such as `tests/sample-test-release.json` with the following structure:\n  \n```json\n{\n  \"action\": \"published\",\n  \"release\": {\n      ...\n  },\n  \"repository\": {\n      ...\n  },\n  \"sender\": {\n      ...\n  }\n}\n```\n\nThis 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.\n\n6. Fill the test json file with the necessary fields to simulate a release event.\n5. Create a test file called `.env` in the main root of the project with the following environmental variables:\n\n```bash\n  INPUT_WEBHOOK_URL=\n  INPUT_COLOR=\n  INPUT_USERNAME=\n  INPUT_AVATAR_URL=\n  INPUT_CONTENT=\n  INPUT_FOOTER_TITLE=\n  INPUT_FOOTER_ICON_URL=\n  INPUT_FOOTER_TIMESTAMP=\n  INPUT_MAX_DESCRIPTION=\n  INPUT_REDUCE_HEADINGS=\n```\n\n8. Fill the `.env` file with your chosen environmental variables values.\n9. Create a Discord webhook in your server, making sure to add the webhook url to the `.env` file under `INPUT_WEBHOOK_URL=`.\n10. Run the action locally with `act release -e \u003cyour.json\u003e` (e.g., `act release -e tests/sample-test-release.json`) and check the output in your Discord server.\n11. Confirm that the action works as expected.\n12. Make your changes and commit them: `git commit -m '\u003ccommit_message\u003e'`. Please follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).\n13. Create the pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsethcohen%2Fgithub-releases-to-discord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsethcohen%2Fgithub-releases-to-discord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsethcohen%2Fgithub-releases-to-discord/lists"}