Skip to content

Commit

Permalink
Merge pull request #2 from girish17/feature/50996-matrix-hookshot-cus…
Browse files Browse the repository at this point in the history
…tomization

Feature/50996 matrix hookshot customization
  • Loading branch information
girish17 authored Feb 14, 2025
2 parents 9c1aa89 + fa18913 commit 2cab13a
Show file tree
Hide file tree
Showing 21 changed files with 1,861 additions and 7 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/webpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: NodeJS with Webpack

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Build
run: |
npm install
npx webpack
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ book
coverage
.nyc_output

# Log files
nohup.out

# Devenv
.devenv*
devenv.local.nix

# direnv
.direnv
.direnv
Binary file added OpenProjectGenericWebhook.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@
[![#hookshot:half-shot.uk](https://img.shields.io/matrix/hookshot:half-shot.uk.svg?server_fqdn=chaotic.half-shot.uk&label=%23hookshot:half-shot.uk&logo=matrix)](https://matrix.to/#/#hookshot:half-shot.uk)
[![Docker Image Version (latest by date)](https://img.shields.io/docker/v/halfshot/matrix-hookshot?sort=semver)](https://hub.docker.com/r/halfshot/matrix-hookshot)

![screenshot](screenshot.png)

A Matrix bot for connecting to external services like GitHub, GitLab, JIRA, and more.

GitHub issues demo
![githubIssuesDemo](githubIssuesDemo.gif)

- Several services are supported out of the box.
- [Webhooks](https://matrix-org.github.io/matrix-hookshot/latest/setup/webhooks.html) let you connect all kinds of services, with the ability to write rich templates using JavaScript.
- **No external database** is required, instead using Matrix state as a persistent store.
- End-to-Bridge encryption allows bots to be used in encrypted Matrix rooms.
- [Powerful widgets](https://matrix-org.github.io/matrix-hookshot/latest/advanced/widgets.html) let you configure Hookshot from a room or the Element Extensions Store.

OpenProject webhooks demo with Hookshot
![OpenProjectGenericWebhook](OpenProjectGenericWebhook.gif)

We richly support the following integrations:

- [Challenge Hound](https://matrix-org.github.io/matrix-hookshot/latest/setup/challengehound.html)
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/room_configuration/gitlab_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This connection supports a few options which can be defined in the room state:

| Option | Description | Allowed values | Default |
|--------|-------------|----------------|---------|
|commandPrefix|Choose the prefix to use when sending commands to the bot|A string, ideally starts with "!"|`!gh`|
|commandPrefix|Choose the prefix to use when sending commands to the bot|A string, ideally starts with "!"|`!gl`|
|enableHooks [^1]|Enable notifications for some event types|Array of: [Supported event types](#supported-event-types) |If not defined, defaults are mentioned below|
|excludingLabels|Never notify on issues matching these label names|Array of: String matching a label name|*empty*|
|ignoreHooks [^1]|**deprecated** Choose to exclude notifications for some event types|Array of: [Supported event types](#supported-event-types) |*empty*|
Expand Down
Binary file added githubIssuesDemo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/AdminRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export class AdminRoom extends AdminRoomCommandHandler {
const enabledCategories = [
this.config.github ? Category.Github : "",
this.config.gitlab ? Category.Gitlab : "",
this.config.openproject ? Category.OpenProject : "",
this.config.jira ? Category.Jira : "",
this.canAdminConnections('github') ? Category.ConnectionManagement : '',
];
Expand Down
8 changes: 8 additions & 0 deletions src/AdminRoomCommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export enum Category {
ConnectionManagement = "Connection Management",
Github = "Github",
Gitlab = "Gitlab",
OpenProject = "OpenProject",
Jira = "Jira",
}

Expand All @@ -26,6 +27,13 @@ export interface AdminAccountData {
enabled: boolean;
}
}
};
openproject?: {
[instanceUrl: string]: {
notifications: {
enabled: boolean;
}
}
}
}

Expand Down
Loading

0 comments on commit 2cab13a

Please sign in to comment.