Compare commits

..

4 Commits

Author SHA1 Message Date
be81716cfe Merge pull request 'Trying to fix report discord task' (#24) from dev into master
All checks were successful
/ build (17, ubuntu-latest) (push) Successful in 4m33s
/ deploy (17, ubuntu-latest) (push) Successful in 6m26s
Reviewed-on: #24
2023-07-26 23:53:11 +02:00
3d3851d032 Merge pull request 'Trying to fix report discord task' (#23) from patch-report1 into dev
Some checks reported warnings
/ build (17, ubuntu-latest) (push) Successful in 4m30s
/ deploy (17, ubuntu-latest) (push) Has been skipped
/ deploy (17, ubuntu-latest) (pull_request) Has been cancelled
/ build (17, ubuntu-latest) (pull_request) Has been cancelled
Reviewed-on: #23
2023-07-26 23:46:29 +02:00
c459bf9397 Trying to fix report discord task
All checks were successful
/ build (17, ubuntu-latest) (pull_request) Successful in 4m45s
/ deploy (17, ubuntu-latest) (pull_request) Has been skipped
2023-07-26 23:36:01 +02:00
969eaf92bc Add project name to reportConfig
All checks were successful
/ build (17, ubuntu-latest) (push) Successful in 6m53s
/ deploy (17, ubuntu-latest) (push) Has been skipped
2023-07-26 23:33:01 +02:00
3 changed files with 6 additions and 3 deletions

View File

@ -13,6 +13,8 @@ on:
env:
REPO_USERNAME: Altarik
REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}
DISCORD_PUB_ID: ${{ secrets.DISCORD_PUB_ID }}
DISCORD_PUB_TOKEN: ${{ secrets.DISCORD_PUB_TOKEN }}
jobs:
build:

View File

@ -16,7 +16,7 @@ String webhookId = getEnv("DISCORD_PUB_ID", local.getProperty("discord_pub_id"))
String webhookToken = getEnv("DISCORD_PUB_TOKEN", local.getProperty("discord_pub_token"))
String repoUrl = "https://repo.altarik.fr/#/" + (project.version.endsWith('SNAPSHOT') ? 'snapshots/' : 'releases/') + project.group.replace(".", "/") + "/" + project.rootProject.name + "/" + project.version
var reportConfig = new ReportDiscord.ReportData("https://discord.com/api/", webhookId, webhookToken, "Update " + project.version + " has been published", repoUrl);
var reportConfig = new ReportDiscord.ReportData("https://discord.com/api/", webhookId, webhookToken, project.rootProject.name, "Update " + project.version + " has been published", repoUrl);
allprojects {
apply plugin: 'maven-publish'

View File

@ -26,7 +26,8 @@ public abstract class ReportDiscord extends DefaultTask {
{
"embeds": [
{
"title": "A new update for Toolbox is available",
"title": "A new update of\s""" + data.projectName() + """
is available",
"description":\s""" + "\"" + message + "\"" + """
,
"url":\s""" + "\"" + data.url() + "\"" + """
@ -48,7 +49,7 @@ public abstract class ReportDiscord extends DefaultTask {
}
}
public record ReportData(String baseUrl, String webhookId, String webhookToken, String message, String url) {
public record ReportData(String baseUrl, String webhookId, String webhookToken, String projectName, String message, String url) {
}