mirror of
https://github.com/SethCohen/github-releases-to-discord
synced 2026-09-14 20:13:23 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65d8ff13e2 | ||
|
|
e114cc793e | ||
|
|
9f49b0c9ab | ||
|
|
1b74a36e5c | ||
|
|
b44c370555 | ||
|
|
a9859d2b26 | ||
|
|
7cc064fafc | ||
|
|
074896c0da | ||
|
|
4517d8d0ec | ||
|
|
ac2e4a38e2 |
@@ -1,5 +1,20 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.5.0](https://github.com/SethCohen/github-release-to-discord/compare/v1.4.0...v1.5.0) (2022-08-24)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* updated action description format ([9f49b0c](https://github.com/SethCohen/github-release-to-discord/commit/9f49b0c9ab5de966ccc4af94863fbddd73bac884))
|
||||||
|
|
||||||
|
## [1.4.0](https://github.com/SethCohen/github-release-to-discord/compare/v1.3.0...v1.4.0) (2022-08-24)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* updated action colour ([ac2e4a3](https://github.com/SethCohen/github-release-to-discord/commit/ac2e4a38e2cad7e65dac53a1b4591fd46d65130d))
|
||||||
|
* updated description ([4517d8d](https://github.com/SethCohen/github-release-to-discord/commit/4517d8d0ec09c575248503c50ed25f15677f8f3d))
|
||||||
|
|
||||||
## [1.3.0](https://github.com/SethCohen/github-release-to-discord/compare/v1.2.0...v1.3.0) (2022-08-24)
|
## [1.3.0](https://github.com/SethCohen/github-release-to-discord/compare/v1.2.0...v1.3.0) (2022-08-24)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,34 @@
|
|||||||
# Hello world javascript action
|
# Github Release To Discord Action
|
||||||
|
|
||||||
This action prints "Hello World" or "Hello" + the name of a person to greet to the log.
|
This action parses a github release and posts it to a discord channel via a discord webhook.
|
||||||
|
## Configuration
|
||||||
|
| Variable | Required | Default | Description |
|
||||||
|
|-------------|----------|----------------------------------------------------------------------------------------------------------------|---------------------------------------------|
|
||||||
|
| webhook_url | ✔ | | Discord's webhook url. Use GH repo secrets. |
|
||||||
|
| colour | ❌ | "2105893" | Decimal colour value for embed. |
|
||||||
|
| username | ❌ | "Release Changelog" | String username for webhook. |
|
||||||
|
| avatar_url | ❌ | ["Profile Picture"](https://cdn.discordapp.com/avatars/487431320314576937/bd64361e4ba6313d561d54e78c9e7171.png) | String url to webhook avatar picture. |
|
||||||
|
|
||||||
## Inputs
|
|
||||||
|
|
||||||
## `who-to-greet`
|
## Output
|
||||||
|

|
||||||
**Required** The name of the person to greet. Default `"World"`.
|
|
||||||
|
|
||||||
## Outputs
|
|
||||||
|
|
||||||
## `time`
|
|
||||||
|
|
||||||
The time we greeted you.
|
|
||||||
|
|
||||||
## Example usage
|
## Example usage
|
||||||
|
|
||||||
uses: actions/hello-world-javascript-action@v1.1
|
```yaml
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
github-release-to-discord:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Handle Release
|
||||||
|
uses: ./ # Uses an action in the root directory
|
||||||
|
id: release
|
||||||
with:
|
with:
|
||||||
who-to-greet: 'Mona the Octocat'
|
webhook_url: ${{ secrets.WEBHOOK_URL }}
|
||||||
|
```
|
||||||
+1
-1
@@ -7,7 +7,7 @@ inputs:
|
|||||||
colour:
|
colour:
|
||||||
description: Decimal colour value for embed.
|
description: Decimal colour value for embed.
|
||||||
required: false
|
required: false
|
||||||
default: '202225'
|
default: '2105893'
|
||||||
username:
|
username:
|
||||||
description: String username for webhook.
|
description: String username for webhook.
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
@@ -27,18 +27,15 @@ async function run () {
|
|||||||
|
|
||||||
const content = await getContext()
|
const content = await getContext()
|
||||||
|
|
||||||
let description = '';
|
const description = content.body
|
||||||
for (const line of content.body) {
|
.replace(/## (.*?)\n/g,function (substring) {
|
||||||
if (line.startsWith('## ')) {
|
const newString = substring.slice(3)
|
||||||
description += `**${line.slice(3)}**\n`;
|
return `**${newString}**\n`
|
||||||
}
|
})
|
||||||
else if (line.startsWith('### ')) {
|
.replace(/### (.*?)\n/g,function (substring) {
|
||||||
description += `**__${line.slice(4)}__**\n`;
|
const newString = substring.slice(4)
|
||||||
}
|
return `**__${newString}__**\n`
|
||||||
else if (line.startsWith('* ')) {
|
})
|
||||||
description += `- ${line.slice(2)}\n`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const embedMsg = {
|
const embedMsg = {
|
||||||
title: `Release ${content.version}`,
|
title: `Release ${content.version}`,
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "github-release-to-discord",
|
"name": "github-release-to-discord",
|
||||||
"version": "1.3.0",
|
"version": "1.5.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "github-release-to-discord",
|
"name": "github-release-to-discord",
|
||||||
"version": "1.3.0",
|
"version": "1.5.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.9.1",
|
"@actions/core": "^1.9.1",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "github-release-to-discord",
|
"name": "github-release-to-discord",
|
||||||
"version": "1.3.0",
|
"version": "1.5.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user