-
Notifications
You must be signed in to change notification settings - Fork 5
feat(slack): add threaded messaging for PR notifications #901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
[puLL-Merge] - brave/security-action@901 DescriptionThis PR adds Slack threading support and security review completion notifications to the security-action GitHub composite action. The main changes include:
Possible Issues
Security Hotspots
Privacy Hotspots
ChangesChangesREADME.md
actions/main/action.cjs
src/sendSlackMessage.js
src/sendSlackMessage.test.js (new file)
src/steps/securityReviewCompleted.js (new file)
src/steps/securityReviewCompleted.test.js (new file)
sequenceDiagram
participant GH as GitHub Action
participant Action as action.cjs
participant Slack as sendSlackMessage
participant API as Slack API
GH->>Action: pull_request event (opened/sync/unlabeled)
Action->>Action: Check if reviewdog enabled
Action->>Action: Run security checks
alt New findings or hotwords
Action->>Slack: sendSlackMessage(prIdentifier)
Slack->>API: conversations.history (find existing thread)
alt Thread exists
Slack->>API: postMessage(thread_ts)
else No thread
Slack->>API: postMessage(metadata with pr_identifier)
end
end
alt Label unlabeled event
Action->>Action: securityReviewCompleted()
alt Label removed by assignee
Action->>Slack: sendSlackMessage(isCompletion=true)
Slack->>API: postMessage to thread
Slack->>API: reactions.add(white_check_mark)
end
end
|
- Messages for the same PR are grouped into threads - Subsequent runs reply to existing thread instead of new messages - Completion message with ✅ reaction when needs-security-review label removed - Add securityReviewCompleted detection function - Update README with threading documentation
f7d4063 to
5f43bf9
Compare
|
The security team is monitoring all repositories for certain keywords. This PR includes the word(s) "password, authentication" and so security team members have been added as reviewers to take a look. |
Test trigger words: