mirror of
https://github.com/SethCohen/github-releases-to-discord
synced 2026-09-14 20:13:23 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f184bc59c7 | ||
|
|
3449e38629 | ||
|
|
93d02ce871 | ||
|
|
5dc41089e6 | ||
|
|
5fd64bf266 |
@@ -4,3 +4,7 @@ out
|
||||
gen
|
||||
.env
|
||||
tests/sample-test-release.json
|
||||
release.json
|
||||
repository.json
|
||||
user.json
|
||||
tests/sample-test-release-v2.json
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
# Changelog
|
||||
|
||||
## [1.15.3](https://github.com/SethCohen/github-releases-to-discord/compare/v1.15.2...v1.15.3) (2024-10-18)
|
||||
|
||||
|
||||
### Documentation
|
||||
|
||||
* add contribution guidelines to README.md ([5fd64bf](https://github.com/SethCohen/github-releases-to-discord/commit/5fd64bf266cea87ab4952ef9a4c6aaf099f266bc))
|
||||
* update version reference in README.md ([93d02ce](https://github.com/SethCohen/github-releases-to-discord/commit/93d02ce8714c5f3e201f5b379422e978b837774b))
|
||||
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
* update .gitignore ([3449e38](https://github.com/SethCohen/github-releases-to-discord/commit/3449e38629b0c40dde5af524e2fef220dab24ead))
|
||||
* update package-lock.json ([5dc4108](https://github.com/SethCohen/github-releases-to-discord/commit/5dc41089e63d18b5b191533c34cdddeab34a07e8))
|
||||
|
||||
## [1.15.2](https://github.com/SethCohen/github-releases-to-discord/compare/v1.15.1...v1.15.2) (2024-10-18)
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,9 @@ A GitHub Action that sends a stylized Discord webhook containing the description
|
||||
- Optional message content outside the embed.
|
||||
|
||||
---
|
||||
|
||||
## Output
|
||||
|
||||

|
||||
|
||||
## Configuration
|
||||
@@ -37,6 +39,7 @@ A GitHub Action that sends a stylized Discord webhook containing the description
|
||||
## Example Usage
|
||||
|
||||
`.github/workflows/github-releases-to-discord.yml`
|
||||
|
||||
```yaml
|
||||
on:
|
||||
release:
|
||||
@@ -49,7 +52,7 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Github Releases To Discord
|
||||
uses: SethCohen/github-releases-to-discord@v1.15.1
|
||||
uses: SethCohen/github-releases-to-discord@v1
|
||||
with:
|
||||
webhook_url: ${{ secrets.WEBHOOK_URL }}
|
||||
color: "2105893"
|
||||
@@ -64,14 +67,65 @@ jobs:
|
||||
```
|
||||
|
||||
## Setup Instructions
|
||||
|
||||
1. Open your **Server Settings** and head into the **Integrations** tab:
|
||||
2. Click the "**Create Webhook**" button to create a new webhook!
|
||||

|
||||

|
||||

|
||||

|
||||
3. Copy the webhook url
|
||||
4. Create a new GitHub repository secret called WEBHOOK_URL and paste the webhook url into it.
|
||||

|
||||

|
||||
5. Save the secret.
|
||||
6. Add the secret to your action configuration.
|
||||
|
||||
And you're done! Whenever you create a new release, the workflow should run and, if properly setup, post to your specified Discord channel.
|
||||
|
||||
## Contributing
|
||||
|
||||
If 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.
|
||||
|
||||
1. Fork the repository.
|
||||
2. Install node and run `npm install`.
|
||||
3. Install [Github Action tester `act`](https://github.com/nektos/act)
|
||||
4. Create a sample test Release file to simulate a webhook payload object such as `tests/sample-test-release.json` with the following structure:
|
||||
|
||||
```json
|
||||
{
|
||||
"action": "published",
|
||||
"release": {
|
||||
...
|
||||
},
|
||||
"repository": {
|
||||
...
|
||||
},
|
||||
"sender": {
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
6. Fill the test json file with the necessary fields to simulate a release event.
|
||||
|
||||
5. Create a test file called `.env` in the main root of the project with the following environmental variables:
|
||||
|
||||
```bash
|
||||
INPUT_WEBHOOK_URL=
|
||||
INPUT_COLOR=
|
||||
INPUT_USERNAME=
|
||||
INPUT_AVATAR_URL=
|
||||
INPUT_CONTENT=
|
||||
INPUT_FOOTER_TITLE=
|
||||
INPUT_FOOTER_ICON_URL=
|
||||
INPUT_FOOTER_TIMESTAMP=
|
||||
INPUT_MAX_DESCRIPTION=
|
||||
INPUT_REDUCE_HEADINGS=
|
||||
```
|
||||
|
||||
8. Fill the `.env` file with your chosen environmental variables values.
|
||||
9. Create a Discord webhook in your server, making sure to add the webhook url to the `.env` file under `INPUT_WEBHOOK_URL=`.
|
||||
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.
|
||||
11. Confirm that the action works as expected.
|
||||
12. Make your changes and commit them: `git commit -m '<commit_message>'`. Please follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
|
||||
13. Create the pull request.
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "github-releases-to-discord",
|
||||
"version": "1.13.0",
|
||||
"version": "1.15.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "github-releases-to-discord",
|
||||
"version": "1.15.2",
|
||||
"version": "1.15.3",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "github-releases-to-discord",
|
||||
"version": "1.15.2",
|
||||
"version": "1.15.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.1",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "github-releases-to-discord",
|
||||
"version": "1.15.2",
|
||||
"version": "1.15.3",
|
||||
"description": "A GitHub Action that automatically sends a stylized Discord webhook of a GitHub Release description to a specified Discord channel.",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
|
||||
Reference in New Issue
Block a user