Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/onebeyond/bamboohrbot
๐ค Bot to publish BambooHR notifications (company holidays, work anniversaries, birthdays, and who is at the office) to slack each weekday.
https://github.com/onebeyond/bamboohrbot
bamboohr hacktoberfest serverless slack slackbot
Last synced: 1 day ago
JSON representation
๐ค Bot to publish BambooHR notifications (company holidays, work anniversaries, birthdays, and who is at the office) to slack each weekday.
- Host: GitHub
- URL: https://github.com/onebeyond/bamboohrbot
- Owner: onebeyond
- Created: 2022-12-29T11:33:37.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T10:03:17.000Z (7 months ago)
- Last Synced: 2024-04-09T23:03:14.516Z (7 months ago)
- Topics: bamboohr, hacktoberfest, serverless, slack, slackbot
- Language: TypeScript
- Homepage:
- Size: 4.37 MB
- Stars: 4
- Watchers: 8
- Forks: 1
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# bamboohrbot
๐ค Bot to publish BambooHR notifications to slack each weekday:
- Who's at the office
- Birthdays
- Work anniversaries, including a welcome message on the first day
- Company-observed holidays## โ๏ธ Setup
- Clone the repository and run `npm install`.
- Ensure your [AWS credentials are available](https://serverless.com/framework/docs/providers/aws/guide/credentials/).
- If you have access, generate a [BambooHR API key](https://www.bamboohr.com/api/documentation/) within your account. Otherwise, have a BambooHR admin at your company generate one for you.
- Determine the BambooHR subdomain associated with your company.
- [Create a new app](https://api.slack.com/apps) on your slack organization, give it the `chat:write` and `chat:write.public` scopes, and [install it](https://api.slack.com/start/quickstart#installing) to your workspace.
- Once deployed, it will run from Monday to Friday at 7 a.m. UTC. This can be adjusted in `serverless.yml` file.### Environment variables
The service needs the following env variables:
```
ENVIRONMENT=
AWS_ACCOUNT_ID=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
BAMBOOHR_SUBDOMAIN=
BAMBOOHR_TIME_OFF_OFFICE_CODE=
EMPLOYEE_COUNTRY_FILTER=
SLACK_CELEBRATIONS_CHANNEL_IDS=
SLACK_BANK_HOLIDAYS_CHANNEL_IDS=
SLACK_OFFICE_CHANNEL_IDS=
```To run it locally, you can create an `.env` file. To deploy it in the cloud, you need to define them in the CI/CD pipeline, as they are read in the GitHub action that deploys it to AWS.
Apart from the env variables, it will read the `BAMBOOHR_KEY`, `SLACK_SIGNING_SECRET`, `SLACK_BOT_TOKEN` secrets from [AWS Secrets Manager](https://aws.amazon.com/en/secrets-manager/).
## ๐๏ธ Usage
### Deployment
In order to deploy the code, you need to run the following command:
```
$ serverless deploy
```### Invocation
After successful deployment, you can invoke the deployed function by using the following command:
```bash
serverless invoke --function main
```## ๐๏ธ Local development
First you need to create an `.env` file with the following variables:
```
ENVIRONMENT=local
AWS_ACCOUNT_ID=
BAMBOOHR_SUBDOMAIN=
BAMBOOHR_TIME_OFF_OFFICE_CODE=
EMPLOYEE_COUNTRY_FILTER=
AWS_ENDPOINT=http://localhost:4566 # Localstack
AWS_REGION=us-east-1 # Localstack
SLACK_CELEBRATIONS_CHANNEL_IDS=
SLACK_BANK_HOLIDAYS_CHANNEL_IDS=
SLACK_OFFICE_CHANNEL_IDS=
```Apart from that, you need to create an `.env` file inside the `docker` folder with the following env variables:
```
BAMBOOHR_KEY=
SLACK_SIGNING_SECRET=
SLACK_BOT_TOKEN=
```And the run [localstack](https://localstack.cloud/) with an instance of AWS Secrets Manager by typing:
```bash
npm run infra:dev:start
```You can invoke your function locally by using the following command:
```bash
serverless invoke local --function main
```When you're finished, remember to run:
```bash
npm run infra:dev:stop
```## ๐ Useful links
- [Slack Block Kit documentation](https://api.slack.com/block-kit)
- [Slack Block Kit builder](https://app.slack.com/block-kit-builder)## Contributors โจ
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
รรฑigo Marquรญnez Prado
๐ ๐ป ๐ ๐ ๐ง ๐ โ ๏ธ
Fran Quesada
๐ ๐ป ๐ ๐ง ๐
Carlos Jimรฉnez
๐
w3dani
๐ ๐
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!