-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add handling for team join event
- Loading branch information
Showing
25 changed files
with
17,054 additions
and
2 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,22 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
rules: { | ||
'type-enum': [ | ||
2, | ||
'always', | ||
[ | ||
'feat', | ||
'fix', | ||
'docs', | ||
'style', | ||
'refactor', | ||
'perf', | ||
'test', | ||
'build', | ||
'ci', | ||
'chore', | ||
'revert' | ||
] | ||
] | ||
} | ||
}; |
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,18 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'prettier' | ||
], | ||
plugins: ['@typescript-eslint'], | ||
env: { | ||
node: true, | ||
jest: true | ||
}, | ||
rules: { | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/no-explicit-any': 'warn', | ||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }] | ||
} | ||
}; |
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,79 @@ | ||
name: CI/CD Pipeline | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x, 18.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run linter | ||
run: npm run lint | ||
|
||
- name: Run tests | ||
run: npm test | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
release: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npx semantic-release | ||
|
||
deploy: | ||
needs: release | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Deploy to Heroku | ||
uses: akhileshns/[email protected] | ||
with: | ||
heroku_api_key: ${{ secrets.HEROKU_API_KEY }} | ||
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }} | ||
heroku_email: ${{ secrets.HEROKU_EMAIL }} | ||
branch: main |
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
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,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no -- commitlint --edit $1 |
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,5 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run lint | ||
npm test |
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,7 @@ | ||
{ | ||
"semi": true, | ||
"trailingComma": "es5", | ||
"singleQuote": true, | ||
"printWidth": 80, | ||
"tabWidth": 2 | ||
} |
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 @@ | ||
module.exports = { | ||
branches: ['main'], | ||
plugins: [ | ||
['@semantic-release/commit-analyzer', { | ||
preset: 'conventionalcommits', | ||
releaseRules: [ | ||
{type: 'docs', scope: 'README', release: 'patch'}, | ||
{type: 'refactor', release: 'patch'}, | ||
{type: 'style', release: 'patch'}, | ||
{type: 'perf', release: 'patch'}, | ||
{type: 'chore', release: false} | ||
] | ||
}], | ||
'@semantic-release/release-notes-generator', | ||
['@semantic-release/changelog', { | ||
changelogFile: 'CHANGELOG.md' | ||
}], | ||
'@semantic-release/npm', | ||
['@semantic-release/git', { | ||
assets: ['package.json', 'CHANGELOG.md'], | ||
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}' | ||
}], | ||
'@semantic-release/github' | ||
] | ||
}; |
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,3 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. |
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 @@ | ||
web: npm start |
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,51 @@ | ||
# slack-mailchimp-integration | ||
This integration adds a new user that signs up to your Slack workspace to a predefined Mailchimp mailing list | ||
# Slack-Mailchimp Integration | ||
|
||
Automatically adds new Slack workspace members to a Mailchimp mailing list. | ||
|
||
## Setup | ||
|
||
1. Clone the repository | ||
2. Install dependencies: | ||
```bash | ||
npm install | ||
``` | ||
3. Create a `.env` file with the following variables: | ||
``` | ||
SLACK_BOT_TOKEN=xoxb-your-token | ||
SLACK_SIGNING_SECRET=your-signing-secret | ||
SLACK_APP_TOKEN=xapp-your-token | ||
MAILCHIMP_API_KEY=your-api-key | ||
MAILCHIMP_LIST_ID=your-list-id | ||
MAILCHIMP_SERVER_PREFIX=usX | ||
PORT=3000 | ||
``` | ||
|
||
## Development | ||
|
||
Run locally: | ||
|
||
``` | ||
curl -X POST https://immune-killdeer-enhanced.ngrok-free.app/slack/events \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{ | ||
"token": "your-verification-token", | ||
"team_id": "T123456", | ||
"api_app_id": "A123456", | ||
"event": { | ||
"type": "team_join", | ||
"user": { | ||
"id": "U123456", | ||
"team_id": "T123456", | ||
"name": "newuser", | ||
"real_name": "New User", | ||
"profile": { | ||
"email": "[email protected]" | ||
} | ||
} | ||
}, | ||
"type": "event_callback", | ||
"event_id": "Ev123456", | ||
"event_time": 1234567890, | ||
"authed_users": ["U123456"] | ||
} | ||
``` |
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,15 @@ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
roots: ['<rootDir>/src'], | ||
testMatch: ['**/*.test.ts', '**/*.spec.ts'], | ||
transform: { | ||
'^.+\\.tsx?$': 'ts-jest' | ||
}, | ||
coverageDirectory: 'coverage', | ||
collectCoverageFrom: [ | ||
'src/**/*.{ts,tsx}', | ||
'!src/**/*.d.ts', | ||
'!src/types/**/*' | ||
] | ||
}; |
Oops, something went wrong.