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: about 2 months 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 (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-24T10:20:23.000Z (3 months ago)
- Last Synced: 2025-04-12T01:15:53.110Z (about 2 months ago)
- Topics: bamboohr, hacktoberfest, serverless, slack, slackbot
- Language: TypeScript
- Homepage:
- Size: 1.69 MB
- Stars: 4
- Watchers: 5
- Forks: 1
- Open Issues: 16
-
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!