forked from blocknative/web3-onboard
-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (32 loc) · 1.82 KB
/
issue-to-notion.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Github issue -> Notion card
on:
workflow_dispatch:
issues:
types: [opened]
jobs:
issue:
name: "Issue to Notion"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
people=$(for i in $(echo $NOTION_USER_IDS | tr "," " "); do echo -n '{"object":"user","id":"'$i'"},'; done)
curl 'https://api.notion.com/v1/pages' \
-H 'Authorization: Bearer '"$NOTION_TOKEN"'' \
-H "Content-Type: application/json" \
-H "Notion-Version: 2022-02-22" \
--data '{"parent":{"type":"database_id","database_id":"'"$DATABASE_ID"'"},"icon":{"type":"emoji","emoji":"🐛"},"properties":{"Name":{"type":"title","title":[{"type":"text","text":{"content":"'"$(echo $TITLE | tr '"' "'")"'"}}]},"Assigned":{"people":['${people:0:-1}']},"Status":{"select":{"name":"'"$STATUS"'"}},"Flag":{"multi_select":[{"name":"'"$FLAG"'"}]},"Database":{"multi_select":[{"name":"'"$DATABASE_NAME"'"}]},"Type":{"multi_select":[{"name":"bug"}]},"Project":{"multi_select":[{"name":"'"$PROJECT_NAME"'"}]}},"children":[{"object":"block","type":"bookmark","bookmark":{"url":"'"$ISSUE_URL"'"}}]}'
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
STATE: ${{ github.event.issue.state }}
ISSUE_URL: ${{ github.event.issue.html_url }}
TITLE: ${{ github.event.issue.title }}
FLAG: Next Sprint
DATABASE_NAME: Product
STATUS: Backlog
# Product Work Board
DATABASE_ID: 69f0e513a59d445b87a1baed729c75c5
PROJECT_NAME: web3-onboard
# User ids of who to assign the card to in notion: Taylor, Adam, Aaron
NOTION_USER_IDS: f6cbb362-4908-4138-9ef0-434003d9a9f8,8a3a2287-5d2c-4665-906d-02ae9a113340,3b407adf-6552-40de-b22f-5efa852c34a2,436b76c5-fed3-42d2-b3ca-49bb882843f8
shell: bash