🤖 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
- Clone the repository and run
npm install
. - Ensure your AWS credentials are available.
- If you have access, generate a BambooHR API key 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 on your slack organization, give it the
chat:write
andchat:write.public
scopes, and install it 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.
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.
In order to deploy the code, you need to run the following command:
$ serverless deploy
After successful deployment, you can invoke the deployed function by using the following command:
serverless invoke --function main
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 with an instance of AWS Secrets Manager by typing:
npm run infra:dev:start
You can invoke your function locally by using the following command:
serverless invoke local --function main
When you're finished, remember to run:
npm run infra:dev:stop
Thanks goes to these wonderful people (emoji key):
Íñigo Marquínez Prado 🐛 💻 📖 🚇 🚧 👀 |
Fran Quesada 🐛 💻 📖 🚧 👀 |
Carlos Jiménez 👀 |
w3dani 🚇 👀 |
This project follows the all-contributors specification. Contributions of any kind welcome!