{"id":13579145,"url":"https://github.com/hanoii/platformsh2slack","last_synced_at":"2025-04-22T18:17:51.091Z","repository":{"id":62514438,"uuid":"69695735","full_name":"hanoii/platformsh2slack","owner":"hanoii","description":"An adapter from platform.sh webhook to slack incoming webhook that can be hosted on a platform.sh app.","archived":false,"fork":false,"pushed_at":"2023-12-19T07:08:16.000Z","size":38,"stargazers_count":20,"open_issues_count":5,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-29T17:35:49.039Z","etag":null,"topics":["platformsh","slack"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hanoii.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2016-09-30T19:27:36.000Z","updated_at":"2022-02-04T22:57:33.000Z","dependencies_parsed_at":"2024-03-17T06:59:40.429Z","dependency_job_id":null,"html_url":"https://github.com/hanoii/platformsh2slack","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanoii%2Fplatformsh2slack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanoii%2Fplatformsh2slack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanoii%2Fplatformsh2slack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanoii%2Fplatformsh2slack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hanoii","download_url":"https://codeload.github.com/hanoii/platformsh2slack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250296275,"owners_count":21407037,"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":["platformsh","slack"],"created_at":"2024-08-01T15:01:36.910Z","updated_at":"2025-04-22T18:17:51.042Z","avatar_url":"https://github.com/hanoii.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Platform.sh -\u003e Slack incoming webhook adapter\n\nThis is a simple php script that translates [Platform.sh](https://platform.sh) webhook into a [Slack](http://slack.com/)\nformatted message.\n\nYou can install this in your php app container and host it there for your project's specific webhooks.\n\nSponsored by [Infomagnet - builds websites to any design using Drupal](https://infomagnet.com).\n\n![slack-example](https://cloud.githubusercontent.com/assets/677879/19004393/2aae68b4-872c-11e6-9ec4-52bbde84d849.png)\n\n## Installation\n\nYou can install the package using the [Composer](https://getcomposer.org/) package manager. You can install it by running this command in your project root:\n\n```sh\ncomposer require hanoii/platformsh2slack\n```\n\nThen [create an incoming webhook](https://my.slack.com/services/new/incoming-webhook) on your Slack account for the package to use. You'll need the webhook URL to instantiate the adapter.\n\n## Basic Usage\n\n```php\n\u003c?php\n\n// Optional settings\n$settings = [\n  'channel' =\u003e '#random',\n  'project' =\u003e 'Some project',\n  // Environment will be appended to the URL\n  'project_url' =\u003e 'https://console.platform.sh/USER/PROJECTID',\n];\n\n$platformsh2slack = new Hanoii\\Platformsh2Slack\\Platformsh2Slack(\n  'https://hooks.slack.com/...',\n  $settings\n);\n\n// Optionally protect the request with a token that has to be present in the Platform.sh webhook\n$platformsh2slack-\u003evalidateToken('1234');\n\n// Send the information to slack\n$platformsh2slack-\u003esend();\n```\n\n## Platform.sh build hook\n\nIf your application (`.platform.app.yaml`) is already being built with composer:\n\n```yaml\nbuild:\n    flavor: composer\n```\n\nYou can simply add:\n\n```json\n    \"hanoii/platformsh2slack\": \"^1.0\"\n```\n\nTo your `composer.json` file of the project and create a small script as per above.\n\nIf not, you will have to add a script to the repository and run composer install on your build hook manually.\n\n## Settings\n\nOption | Type | Default | Description\n----- | ---- | ------- | -----------\n`channel` | string | `null` | The default channel that messages will be sent to, otherwise defaults to what's set on the Slack's incoming webhook\n`commit_limit` | int | `10` | The number of commits from the payload to include in the Slack message \n`routes` | bool | `false` | Whether to show project's routes on every slack message. If false, it will be shown only when you branch.\n`redirects` | bool | `false` | Whether to include project's redirects with routes on every Slack message. If false, redirects will be shown only when you branch.\n`basic_auth` | bool | `false` | Whether to show project environment's HTTP Authentication username and password in Slack message.  WARNING: If true, potentially sensitive data passwords will be sent in the clear to your Slack channel.\n`configurations` | bool | `false` | Whether to show project's configurations on every slack message. If false, it will be shown only for master when you push, merge or have a subscription plan update.\n`attachment_color` | string | `'#e8e8e8'` | RGB color for Slack attachment.\n`project` | string | `null` | If present, it will be used as the project name instead of the default string. Project name is misisng in Platform.sh's payload.\n`project_url` | string | `null` | If present, the project name will be used as a link to this URL on Slack notifications. Environment branch will be appended automatically to the URL.\n`debug` | string | `null` | An optional path where posssible unhandled webhooks JSON can be saved. This is useful if you want to send over the json for me to add support for it.\n`debug_all` | boolean | `false` | If `debug` is set, it saves the JSON of every webhook sent, not only the unhandled ones.\n`active` | boolean | `false` | If `active` is set, only webhooks of active environments will be sent to platform. Useful for some external integrations.\n\n## Token\n\nThis is an optional feature you can choose to use on the script. It's a nice simple validation so that you script is not abused.\n\nIf you added:\n\n```php\n$platformsh2slack-\u003evalidateToken('1234');\n```\n\nto your script, you will have to append the token the Platform.sh's webhook integration URL.\n\n## Add the integration on platform\n\nRun the following:\n\n```bash\nplatform integration:add --type=webhook --url=\"https://www.example.com/platformsh2slack.php?token=TOKEN\"\n```\n\n## Environoments\n\nYou can have this script on any environment, even master. As far as my trials went, even pushing to master works.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanoii%2Fplatformsh2slack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanoii%2Fplatformsh2slack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanoii%2Fplatformsh2slack/lists"}