diff --git a/.github/workflows/mark-as-draft-on-requesting-changes.yml b/.github/workflows/mark-as-draft-on-requesting-changes.yml index 70fcdebb2..fea29ab86 100644 --- a/.github/workflows/mark-as-draft-on-requesting-changes.yml +++ b/.github/workflows/mark-as-draft-on-requesting-changes.yml @@ -12,9 +12,6 @@ permissions: {} jobs: mark-draft: runs-on: ubuntu-latest - permissions: - pull-requests: write - contents: read if: | ( github.event_name == 'pull_request_review' && @@ -27,7 +24,7 @@ jobs: - name: Add label on requested changes if: github.event_name == 'pull_request_review' env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.MARK_AS_DRAFT_TOKEN }} PR_NUMBER: ${{ github.event.pull_request.number }} REPO: ${{ github.repository }} run: | @@ -37,17 +34,16 @@ jobs: - name: Mark PR as draft env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.MARK_AS_DRAFT_TOKEN }} PR_URL: ${{ github.event.pull_request.html_url }} run: gh pr ready "$PR_URL" --undo || true ready-for-review: runs-on: ubuntu-latest if: github.event_name == 'pull_request' && github.event.action == 'ready_for_review' - steps: - name: Update labels for review env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.MARK_AS_DRAFT_TOKEN }} PR_NUMBER: ${{ github.event.pull_request.number }} REPO: ${{ github.repository }} run: | diff --git a/package-lock.json b/package-lock.json index f4ebd7098..db0a67846 100644 --- a/package-lock.json +++ b/package-lock.json @@ -132,8 +132,8 @@ "favico.js": "~0.3.10", "get-port-please": "^3.1.1", "node-ssh": "~13.1.0", - "postcss-html": "~1.5.0", - "postcss-rtlcss": "~3.7.2", + "postcss-html": "~1.8.1", + "postcss-rtlcss": "~5.7.1", "postcss-scss": "~4.0.4", "prettier": "^3.7.4", "prismjs": "~1.30.0", @@ -12661,9 +12661,9 @@ } }, "node_modules/js-tokens": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.3.tgz", - "integrity": "sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", "dev": true, "license": "MIT" }, @@ -15166,15 +15166,15 @@ } }, "node_modules/postcss-html": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/postcss-html/-/postcss-html-1.5.0.tgz", - "integrity": "sha512-kCMRWJRHKicpA166kc2lAVUGxDZL324bkj/pVOb6RhjB0Z5Krl7mN0AsVkBhVIRZZirY0lyQXG38HCVaoKVNoA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/postcss-html/-/postcss-html-1.8.1.tgz", + "integrity": "sha512-OLF6P7qctfAWayOhLpcVnTGqVeJzu2W3WpIYelfz2+JV5oGxfkcEvweN9U4XpeqE0P98dcD9ssusGwlF0TK0uQ==", "dev": true, "license": "MIT", "dependencies": { "htmlparser2": "^8.0.0", - "js-tokens": "^8.0.0", - "postcss": "^8.4.0", + "js-tokens": "^9.0.0", + "postcss": "^8.5.0", "postcss-safe-parser": "^6.0.0" }, "engines": { @@ -15209,19 +15209,19 @@ "license": "MIT" }, "node_modules/postcss-rtlcss": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/postcss-rtlcss/-/postcss-rtlcss-3.7.2.tgz", - "integrity": "sha512-GurrGedCKvOTe1QrifI+XpDKXA3bJky1v8KiOa/TYYHs1bfJOxI53GIRvVSqLJLly7e1WcNMz8KMESTN01vbZQ==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/postcss-rtlcss/-/postcss-rtlcss-5.7.1.tgz", + "integrity": "sha512-zE68CuARv5StOG/UQLa0W1Y/raUTzgJlfjtas43yh3/G1BFmoPEaHxPRHgeowXRFFhW33FehrNgsljxRLmPVWw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "rtlcss": "^3.5.0" + "rtlcss": "4.3.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=18.0.0" }, "peerDependencies": { - "postcss": "^8.0.0" + "postcss": "^8.4.21" } }, "node_modules/postcss-safe-parser": { @@ -16508,19 +16508,22 @@ } }, "node_modules/rtlcss": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/rtlcss/-/rtlcss-3.5.0.tgz", - "integrity": "sha512-wzgMaMFHQTnyi9YOwsx9LjOxYXJPzS8sYnFaKm6R5ysvTkwzHiB0vxnbHwchHQT65PTdBjDG21/kQBWI7q9O7A==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/rtlcss/-/rtlcss-4.3.0.tgz", + "integrity": "sha512-FI+pHEn7Wc4NqKXMXFM+VAYKEj/mRIcW4h24YVwVtyjI+EqGrLc2Hx/Ny0lrZ21cBWU2goLy36eqMcNj3AQJig==", "dev": true, "license": "MIT", "dependencies": { - "find-up": "^5.0.0", + "escalade": "^3.1.1", "picocolors": "^1.0.0", - "postcss": "^8.3.11", + "postcss": "^8.4.21", "strip-json-comments": "^3.1.1" }, "bin": { "rtlcss": "bin/rtlcss.js" + }, + "engines": { + "node": ">=12.0.0" } }, "node_modules/run-applescript": { diff --git a/package.json b/package.json index 9b08a5e69..5574a67b0 100644 --- a/package.json +++ b/package.json @@ -194,8 +194,8 @@ "favico.js": "~0.3.10", "get-port-please": "^3.1.1", "node-ssh": "~13.1.0", - "postcss-html": "~1.5.0", - "postcss-rtlcss": "~3.7.2", + "postcss-html": "~1.8.1", + "postcss-rtlcss": "~5.7.1", "postcss-scss": "~4.0.4", "prettier": "^3.7.4", "prismjs": "~1.30.0", diff --git a/server/notification-providers/discord.js b/server/notification-providers/discord.js index 79768e3df..3ed509cea 100644 --- a/server/notification-providers/discord.js +++ b/server/notification-providers/discord.js @@ -11,6 +11,11 @@ class Discord extends NotificationProvider { async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { const okMsg = "Sent Successfully."; + // Discord Message Flags + // @see https://discord.com/developers/docs/resources/message#message-object-message-flags + // This message will not trigger push and desktop notifications + const SUPPRESS_NOTIFICATIONS_FLAG = 1 << 12; + try { let config = this.getAxiosConfigWithProxy({}); const discordDisplayName = notification.discordUsername || "Uptime Kuma"; @@ -41,6 +46,9 @@ class Discord extends NotificationProvider { if (notification.discordChannelType === "createNewForumPost") { discordtestdata.thread_name = notification.postName; } + if (notification.discordSuppressNotifications) { + discordtestdata.flags = SUPPRESS_NOTIFICATIONS_FLAG; + } await axios.post(webhookUrl.toString(), discordtestdata, config); return okMsg; } @@ -89,6 +97,9 @@ class Discord extends NotificationProvider { if (notification.discordPrefixMessage) { discorddowndata.content = notification.discordPrefixMessage; } + if (notification.discordSuppressNotifications) { + discorddowndata.flags = SUPPRESS_NOTIFICATIONS_FLAG; + } await axios.post(webhookUrl.toString(), discorddowndata, config); return okMsg; @@ -140,6 +151,9 @@ class Discord extends NotificationProvider { if (notification.discordPrefixMessage) { discordupdata.content = notification.discordPrefixMessage; } + if (notification.discordSuppressNotifications) { + discordupdata.flags = SUPPRESS_NOTIFICATIONS_FLAG; + } await axios.post(webhookUrl.toString(), discordupdata, config); return okMsg; diff --git a/src/components/notifications/Discord.vue b/src/components/notifications/Discord.vue index b65eb706a..6eff2a887 100644 --- a/src/components/notifications/Discord.vue +++ b/src/components/notifications/Discord.vue @@ -102,6 +102,24 @@ + +
+
+ + +
+
+ {{ $t("discordSuppressNotificationsHelptext") }} +
+
diff --git a/src/lang/en.json b/src/lang/en.json index 8002bc2d7..19d259222 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -1265,6 +1265,8 @@ "Matomo": "Matomo", "Umami": "Umami", "Disable URL in Notification": "Disable URL in Notification", + "Suppress Notifications": "Suppress Notifications", + "discordSuppressNotificationsHelptext": "When enabled, messages will be posted to the channel but won't trigger push or desktop notifications for recipients.", "Ip Family": "IP Family", "ipFamilyDescriptionAutoSelect": "Uses the {happyEyeballs} for determining the IP family.", "Happy Eyeballs algorithm": "Happy Eyeballs algorithm",