-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from OWASP-BLT/bot-poc
- Loading branch information
Showing
13 changed files
with
147 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: CI/CD | ||
on: | ||
- merge_group | ||
- pull_request | ||
- push | ||
- workflow_dispatch | ||
|
||
env: | ||
FORCE_COLOR: 1 | ||
|
||
concurrency: | ||
cancel-in-progress: true | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
|
||
jobs: | ||
pre-commit: | ||
name: Run pre-commit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
local_settings.py | ||
__pycache__ | ||
.env | ||
.ruff_cache | ||
.secrets | ||
.venv | ||
*.code-workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-ast | ||
- id: check-builtin-literals | ||
- id: check-yaml | ||
- id: fix-encoding-pragma | ||
args: | ||
- --remove | ||
- id: mixed-line-ending | ||
args: | ||
- --fix=lf | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
exclude: ^(docs) | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.1.13 | ||
hooks: | ||
- id: ruff | ||
args: | ||
- --fix | ||
- id: ruff-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SLACK_APP_TOKEN=xapp-token | ||
SLACK_BOT_TOKEN=xoxb-token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
# BLT-Sammich | ||
|
||
The Slack bot for BLT | ||
|
||
## Development | ||
|
||
`poetry install` | ||
|
||
`poetry run slack-machine` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
display_information: | ||
name: Sammich Dev | ||
features: | ||
bot_user: | ||
display_name: Sammich Dev | ||
always_online: false | ||
slash_commands: | ||
- command: /demo | ||
description: Show demo output | ||
should_escape: false | ||
oauth_config: | ||
scopes: | ||
bot: | ||
- channels:read | ||
- commands | ||
- groups:read | ||
- im:read | ||
- mpim:read | ||
- users:read | ||
settings: | ||
interactivity: | ||
is_enabled: true | ||
org_deploy_enabled: false | ||
socket_mode_enabled: true | ||
token_rotation_enabled: false |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,16 @@ description = "" | |
authors = ["Sarthak5598 <[email protected]>"] | ||
readme = "README.md" | ||
|
||
packages = [{ include = "sammich", from = "src" }] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.10" | ||
slack-machine = "^0.37.0" | ||
python-dotenv = "^1.0.1" | ||
gitpython = "^3.1.43" | ||
slack-sdk = "^3.27.2" | ||
slackeventsapi = "^3.0.1" | ||
holidays = "^0.49" | ||
|
||
|
||
[build-system] | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from dotenv import dotenv_values | ||
|
||
secrets = dotenv_values(".secrets") | ||
|
||
SLACK_APP_TOKEN = secrets["SLACK_APP_TOKEN"] | ||
SLACK_BOT_TOKEN = secrets["SLACK_BOT_TOKEN"] | ||
|
||
PLUGINS = ("sammich.plugins.demo.DemoPlugin",) |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from machine.plugins.base import MachineBasePlugin | ||
from machine.plugins.decorators import command | ||
|
||
|
||
class DemoPlugin(MachineBasePlugin): | ||
"""Demo plugin""" | ||
|
||
@command("/demo") | ||
async def demo(self, command): | ||
await command.say("This is a demo response!") |