{"id":18820396,"url":"https://github.com/clockwisesoftware/deploy-notify-slack","last_synced_at":"2026-05-05T21:31:28.165Z","repository":{"id":200592928,"uuid":"705868019","full_name":"ClockwiseSoftware/deploy-notify-slack","owner":"ClockwiseSoftware","description":"Send notification about application deployments to a Slack channel","archived":false,"fork":false,"pushed_at":"2023-12-13T18:26:10.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T07:35:44.672Z","etag":null,"topics":["nodejs","slack","webhooks"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ClockwiseSoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-16T21:08:29.000Z","updated_at":"2023-12-11T12:51:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"1867f0c3-3212-4795-a692-185344d08ca2","html_url":"https://github.com/ClockwiseSoftware/deploy-notify-slack","commit_stats":null,"previous_names":["clockwisesoftware/deploy-notify-slack"],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClockwiseSoftware%2Fdeploy-notify-slack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClockwiseSoftware%2Fdeploy-notify-slack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClockwiseSoftware%2Fdeploy-notify-slack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClockwiseSoftware%2Fdeploy-notify-slack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ClockwiseSoftware","download_url":"https://codeload.github.com/ClockwiseSoftware/deploy-notify-slack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239758830,"owners_count":19692034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nodejs","slack","webhooks"],"created_at":"2024-11-08T00:28:20.129Z","updated_at":"2026-05-05T21:31:28.149Z","avatar_url":"https://github.com/ClockwiseSoftware.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deploy-notify-slack\n\n\u003ca href=\"https://www.npmjs.com/package/deploy-notify-slack\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/deploy-notify-slack\" alt=\"NPM Version\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/deploy-notify-slack\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/deploy-notify-slack\" alt=\"Package License\" /\u003e\u003c/a\u003e\n\nSend Slack notifications about deployments via incoming webhooks.\n\n## Features\n\n- Zero dependencies - uses native Node.js `fetch()` API\n- Automatic changelog attachment from Markdown files\n- Customizable colors, emojis, and titles\n- Full custom message support via Slack Block Kit\n- Simple environment variable configuration\n\n## Requirements\n\n- **Node.js 21+** (uses native `fetch()` API)\n\n\u003e Need Node.js 8.x-20.x support? Use [v0.5.10](https://www.npmjs.com/package/deploy-notify-slack/v/0.5.10)\n\n## Quick Start\n\n1. Generate a [Slack Webhook URL](https://api.slack.com/messaging/webhooks)\n\n2. Run with npx (no installation required):\n   ```bash\n   SLACK_WEBHOOK_URL=https://hooks.slack.com/services/XXX \\\n   STAGE=production \\\n   VERSION=1.0.0 \\\n   npx deploy-notify-slack\n   ```\n\n   Or install and run with node:\n   ```bash\n   npm install deploy-notify-slack\n   SLACK_WEBHOOK_URL=https://hooks.slack.com/services/XXX \\\n   STAGE=production \\\n   VERSION=1.0.0 \\\n   node ./node_modules/deploy-notify-slack/notify.js\n   ```\n\n## Installation\n\n**npx (no install required):**\n```bash\nnpx deploy-notify-slack\n```\n\n**Local install (recommended for CI/CD):**\n```bash\nnpm install --save-dev deploy-notify-slack\n# Run with npx:\nnpx deploy-notify-slack\n# Or run with node:\nnode ./node_modules/deploy-notify-slack/notify.js\n```\n\n**Global install:**\n```bash\nnpm install --location=global deploy-notify-slack\ndeploy-notify-slack\n```\n\n## Configuration\n\n### Required Environment Variables\n\n| Variable | Description |\n|----------|-------------|\n| `SLACK_WEBHOOK_URL` | Webhook URL for your Slack channel ([how to generate](https://api.slack.com/messaging/webhooks)) |\n| `STAGE` | Deployment stage (e.g., `dev`, `staging`, `prod`) |\n| `VERSION` | Version being deployed |\n\n### Optional Environment Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `TITLE` | `Deployment` | Notification title |\n| `COLOR` | `7f8583` | Left bar color (hex without `#`) |\n| `EMOJI` | `:rocket:` | Title emoji |\n| `MAX_BLOCKS` | `5` | Max 2500-char blocks before truncation |\n| `CHANGELOG_PATH` | `./changelog` | Path to changelog directory |\n| `FAILS_IF_NOT_SENT` | `false` | Exit with error if send fails |\n| `CUSTOM_MESSAGE` | - | JSON for custom Slack Block Kit message |\n\n### Changelog File Resolution\n\nThe script looks for changelog files in the following order:\n\n1. `{CHANGELOG_PATH}/{STAGE}-v{VERSION}.md` (stage-specific, e.g., `prod-v1.0.0.md`)\n2. `{CHANGELOG_PATH}/v{VERSION}.md` (version-specific, e.g., `v1.0.0.md`)\n3. `{CHANGELOG_PATH}/changelog.md` (fallback)\n\nIf no changelog file is found, the notification is sent without a changelog attachment.\n\n## CI/CD Integration\n\n### Bitbucket Pipelines\n\n**Using npx (recommended):**\n```yaml\n- step:\n    name: Notify Slack\n    image: node:24-alpine\n    script:\n      - VERSION=$(npm run version --silent)\n      - SLACK_WEBHOOK_URL=${SLACK_WEBHOOK_URL} STAGE=dev VERSION=$VERSION CHANGELOG_PATH=$PWD/changelog npx deploy-notify-slack@^0.6\n```\n\n\u003e The `version` script above is `echo $npm_package_version` in package.json\n\n**Local install (caches better in CI):**\n```yaml\n- step:\n    name: Notify Slack\n    image: node:24-alpine\n    script:\n      - npm install --no-save deploy-notify-slack@^0.6\n      - VERSION=$(npm run version --silent)\n      - SLACK_WEBHOOK_URL=${SLACK_WEBHOOK_URL} STAGE=dev VERSION=$VERSION CHANGELOG_PATH=$PWD/changelog npx deploy-notify-slack\n```\n\n**Full pipeline example (NestJS + AWS Elastic Beanstalk):**\n```yaml\nimage: atlassian/default-image:2\nclone:\n  depth: full\npipelines:\n  default:\n    - step:\n        name: Test and Build\n        image: node:24-alpine\n        caches:\n          - node\n        script:\n          - npm ci\n          - npm run test:ci\n          - npm run build\n        services:\n          - database\n        artifacts:\n          - node_modules/**\n          - dist/**\n    - step:\n        name: Pack and deploy to bundle\n        script:\n          - VERSION=$(npm run version --silent)\n          - cp .env.static .env\n          - zip -r application.zip . -x \"src/*\" -x \"docker/*\" -x \"test/*\" -x \"cloudformation/*\"\n          - pipe: atlassian/aws-elasticbeanstalk-deploy:1.0.2\n            variables:\n              AWS_ACCESS_KEY_ID: $AWS_DEV_ACCESS_KEY_ID\n              AWS_SECRET_ACCESS_KEY: $AWS_DEV_SECRET_ACCESS_KEY\n              AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION\n              S3_BUCKET: $AWS_DEV_DEPLOY_BUCKET\n              VERSION_LABEL: \"DEV-${VERSION}-${BITBUCKET_BUILD_NUMBER}-${BITBUCKET_COMMIT:0:8}\"\n              APPLICATION_NAME: $AWS_DEV_APP_NAME\n              ENVIRONMENT_NAME: $AWS_DEV_EB_ENV_NAME\n              ZIP_FILE: \"application.zip\"\n    - step:\n        name: Notify Slack\n        image: node:24-alpine\n        script:\n          - VERSION=$(npm run version --silent)\n          - SLACK_WEBHOOK_URL=${SLACK_WEBHOOK_URL} STAGE=dev VERSION=$VERSION CHANGELOG_PATH=$PWD/changelog npx deploy-notify-slack@^0.6\n\ndefinitions:\n  services:\n    database:\n      image: postgres\n      user: postgres\n      variables:\n        POSTGRES_DB: test\n        POSTGRES_USER: api\n        POSTGRES_PASSWORD: example\n```\n\n## Custom Messages\n\nYou can specify your own message template instead of the default one using the `CUSTOM_MESSAGE` environment variable.\n\nUse the [Slack Block Kit Builder](https://api.slack.com/tools/block-kit-builder) to design your message, then pass it as JSON:\n\n**Example message.json:**\n```json\n{\n  \"blocks\": [\n    {\n      \"type\": \"header\",\n      \"text\": {\n        \"type\": \"plain_text\",\n        \"text\": \":flying_saucer: New API deploy of stage *DEV*\",\n        \"emoji\": true\n      }\n    }\n  ]\n}\n```\n\n**Usage:**\n```bash\nCUSTOM_MESSAGE=$(cat message.json)\n# With npx:\nSLACK_WEBHOOK_URL=${SLACK_WEBHOOK_URL} CUSTOM_MESSAGE=$CUSTOM_MESSAGE npx deploy-notify-slack\n# Or with node:\nSLACK_WEBHOOK_URL=${SLACK_WEBHOOK_URL} CUSTOM_MESSAGE=$CUSTOM_MESSAGE node ./node_modules/deploy-notify-slack/notify.js\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclockwisesoftware%2Fdeploy-notify-slack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclockwisesoftware%2Fdeploy-notify-slack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclockwisesoftware%2Fdeploy-notify-slack/lists"}