Skip to content

feat(slack-notify): implement in TypeScript and share the Slack transport - #268

Merged
joakimen merged 1 commit into
masterfrom
feat/slack-notify-typescript
Sep 15, 2026
Merged

joakimen merged 1 commit into
masterfrom
feat/slack-notify-typescript

Conversation

@joakimen

@joakimen joakimen commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Turns the untyped .mjs into a pure core plus a shell, and moves the posting into lib/slack.ts so aikido-scan stops carrying its own copy.

Unit tests now cover choosing between an app token and a webhook, and building the request body.

Behaviour

Failures report a reason and exit 1 instead of throwing a stack trace. The token and webhook URL are masked, which neither action did.

A payload that parses as JSON but is not an object is refused; spreading a number or an array produced a body Slack accepted and posted as nothing useful.

Comment thread slack-notify/src/main.ts

if (input("dry-run") === "true") {
process.stdout.write("Dry run, so the payload was built but not sent\n")
if (runningInActions()) writeOutputs([{ name: "payload", value: body }])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The writeOutputs call emits the complete user-supplied body, which may contain personal data from the payload.

Details

✨ AI Reasoning
​The dry-run branch writes the complete user-provided body to GitHub Actions outputs. Since body is built from the submitted payload, it may include personal data and become visible in workflow metadata or logs.

🔧 How do I fix it?
Keep sensitive data such as emails, passwords, and tokens out of logs. When logging values tied to a user, prefer a safe identifier like a user ID over the raw input, and strip line breaks from any user-provided text you do log.

Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AikidoSec ignore: this is a code path used for testing

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Based on your feedback, we ignored this issue because of the following reason:

this is a code path used for testing

…port

Moves posting into lib/slack.ts so aikido-scan stops carrying its own copy of
it. Choosing between an app token and a webhook, and building the request body,
are now tested.

Failures report a reason rather than throwing a stack trace into the log, the
token and webhook URL are masked, and a payload that is not a JSON object is
refused instead of being posted as an empty one.

Inputs, outputs and request bodies are unchanged.
@joakimen
joakimen force-pushed the feat/slack-notify-typescript branch from 148142c to cc70df1 Compare September 15, 2026 12:35
@joakimen
joakimen merged commit a6e4f73 into master Sep 15, 2026
4 checks passed
@joakimen
joakimen deleted the feat/slack-notify-typescript branch September 15, 2026 12:37
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.18.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant