Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/litencatt/notion-db-pages-payload-for-slack

Generate payload.json from Notion DB pages query result for Slack message
https://github.com/litencatt/notion-db-pages-payload-for-slack

notion notion-database slack-notifications

Last synced: 9 days ago
JSON representation

Generate payload.json from Notion DB pages query result for Slack message

Awesome Lists containing this project

README

        

## Slack send payload generate GitHub Action
Generate a Slack send payload json file from Notion DB query result.

### Setup
- Slack
- [Slack Webhook Setup](https://github.com/slackapi/slack-github-action/blob/main/README.md#setup)
- Notion
- [Create Notion Integration](https://developers.notion.com/docs/create-a-notion-integration)

### Usage
- This action is supposed to be used with [slackapi/slack-github-action](https://github.com/slackapi/slack-github-action)
- This action generate a payload data file to `./payload.json`
- And then you passing it to `slackapi/slack-github-action`.`payload-file-path`.

#### Notion DB pages example
image

#### Slack Notify message example
image


```yml
name: Send filtered Notion DB pages action
on:
push:
branches: [ "main" ]
workflow_dispatch:

jobs:
notify:
runs-on: ubuntu-latest

steps:
- name: Generate send payload for slack
uses: litencatt/[email protected]
env:
NOTION_API_TOKEN: ${{ secrets.NOTION_API_TOKEN }}
NOTION_DB_ID: ${{ secrets.NOTION_DB_ID }}
with:
header: Header
description: Description
filter: |
{
"property": "Select",
"select": {
"equals": "Foo"
}
}

- name: Send custom JSON data to Slack workflow
id: slack
uses: slackapi/[email protected]
with:
payload-file-path: "./payload.json"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
```