Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
322414c
build(deps): use @slack/webhook + p-retry, drop axios
zimeg Jun 30, 2026
ff62bc4
test: stub @slack/webhook send() instead of axios
zimeg Jun 30, 2026
b212a66
refactor: drop axios from config, let SDK own webhook User-Agent
zimeg Jun 30, 2026
f6e2eae
test: webhook techniques via @slack/webhook with p-retry gating
zimeg Jun 30, 2026
074e58f
feat: post webhooks via @slack/webhook with action-side retries
zimeg Jun 30, 2026
12111a6
test: drop trailing blank after removing duplicate metadata test
zimeg Jun 30, 2026
f0480df
refactor: delegate webhook retries to @slack/webhook SDK
zimeg Jul 2, 2026
08d6c7a
build(deps): sync lockfile with @slack/webhook retry deps
zimeg Jul 2, 2026
90399da
feat: instrument @slack/webhook requests with the action User-Agent
zimeg Jul 7, 2026
629012b
fix: restore proxy protocol validation in webhook proxies()
zimeg Jul 7, 2026
78332d8
refactor: build webhook clients via config.webhook in post()
zimeg Jul 7, 2026
0a3e445
docs: restore retries() summary and required option param
zimeg Jul 7, 2026
c0b1d99
fix: restore non-HTTPS webhook proxy skip in proxies()
zimeg Jul 7, 2026
081de9d
docs: reference both proxy PRs in proxies() JSDoc
zimeg Jul 7, 2026
be24575
refactor: return from post() switch cases instead of break
zimeg Jul 7, 2026
76060ba
refactor: return proxy agent directly from proxies()
zimeg Jul 7, 2026
f48a437
docs: restore original proxies() summary line
zimeg Jul 7, 2026
174408b
docs: trim Webhook class doc and say package over SDK
zimeg Jul 7, 2026
79632a1
docs: restore original Webhook class summary, keep reference link
zimeg Jul 7, 2026
f723656
test: nest webhook stubs under a shared webhook mock
zimeg Jul 7, 2026
9992ffa
test: import @slack/webhook as a namespace
zimeg Jul 7, 2026
c613aad
test: order the webhook mock alphabetically after webapi
zimeg Jul 7, 2026
bd0ad53
test: restore the missing-webhook guard test for proxies()
zimeg Jul 7, 2026
1f35361
test: restore try/catch success wrapper and two-line retries setup
zimeg Jul 7, 2026
1bf60fd
test: keep the unknown-url-protocol proxy test wording from main
zimeg Jul 7, 2026
27b568c
test: restore original retries test names
zimeg Jul 7, 2026
ff5229b
build: depend on published @slack/webhook 7.2.0-rc.1
zimeg Jul 7, 2026
2419dc7
Merge origin/main into webhook-trigger-sdk
zimeg Jul 7, 2026
9b4fd31
test: drive webhook metadata test through webhook inputs
zimeg Jul 7, 2026
4fbd824
test: mirror client retry tests and drop unused p-retry
zimeg Jul 7, 2026
ab85bec
test: fix mislabeled client instance in retry tests
zimeg Jul 7, 2026
3cb2eb4
test: fix leading-space rapid retries case for webhook
zimeg Jul 7, 2026
f4e747d
test: assert error message propagates on webhook send failures
zimeg Jul 7, 2026
dd460ac
test: cover the errors-enabled webhook throw path
zimeg Jul 7, 2026
8d5b655
test: exercise webhook failures with errors input enabled
zimeg Jul 7, 2026
7341171
test: drop messages from the webhook failure assert.fail calls
zimeg Jul 7, 2026
67834be
test: reassert payload and response output on webhook failures
zimeg Jul 7, 2026
39a1599
test: keep the malformed textt payload in the incoming failure test
zimeg Jul 7, 2026
4819c47
test: restore proxies test order and http-skip test name
zimeg Jul 7, 2026
fc8f5cc
test: order the https proxy agent test before the no-proxy case
zimeg Jul 7, 2026
e26bbfc
test: cover http proxy agent and unknown webhook type paths
zimeg Jul 7, 2026
7631131
test: drop the message from the unknown-type assert.fail
zimeg Jul 7, 2026
7c83ef1
feat: use the @slack/webhook retryPolicies namespace export
zimeg Jul 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
186 changes: 83 additions & 103 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
"@actions/github": "^9.1.1",
"@slack/logger": "^4.0.1",
"@slack/web-api": "^7.16.0",
"axios": "^1.18.1",
"axios-retry": "^4.5.0",
"@slack/webhook": "7.2.0-rc.2",
"flat": "^6.0.1",
"https-proxy-agent": "^9.0.0",
"js-yaml": "^4.2.0",
Expand Down
24 changes: 11 additions & 13 deletions src/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os from "node:os";
import webapi from "@slack/web-api";
import axios from "axios";
import webhook from "@slack/webhook";
import packageJson from "../package.json" with { type: "json" };
import Content from "./content.js";
import SlackError from "./errors.js";
Expand Down Expand Up @@ -60,11 +59,6 @@ export default class Config {
*/
inputs;

/**
* @type {import("axios").AxiosStatic} - The axios client.
*/
axios;

/**
* @type {Content} - The parsed payload data to send.
*/
Expand All @@ -87,6 +81,11 @@ export default class Config {
*/
webapi;

/**
* @type {import("@slack/webhook")} - Slack webhook client.
*/
webhook;

/**
* Gather values from the job inputs and use defaults or error for the missing
* ones.
Expand All @@ -98,10 +97,10 @@ export default class Config {
* @param {import("@actions/core")} core - GitHub Actions core utilities.
*/
constructor(core) {
this.axios = axios;
this.core = core;
this.logger = new Logger(core).logger;
this.webapi = webapi;
this.webhook = webhook;
this.inputs = {
api: core.getInput("api"),
errors: core.getBooleanInput("errors"),
Expand Down Expand Up @@ -137,11 +136,10 @@ export default class Config {
name: packageJson.name,
version: packageJson.version,
});
this.axios.defaults.headers.common["User-Agent"] =
`${packageJson.name.replace("/", ":")}/${packageJson.version} ` +
`axios/${this.axios.VERSION} ` +
`node/${process.version.replace("v", "")} ` +
`${os.platform()}/${os.release()}`;
this.webhook.addAppMetadata({
name: packageJson.name,
version: packageJson.version,
});
}

/**
Expand Down
Loading
Loading