Skip to content

Commit bb93a28

Browse files
Create issue-to-notion.yml
1 parent 3eae714 commit bb93a28

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/issue-to-notion.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Github issue -> Notion card
2+
on:
3+
workflow_dispatch:
4+
issues:
5+
types: [opened]
6+
jobs:
7+
issue:
8+
name: "Issue to Notion"
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- run: |
13+
people=$(for i in $(echo $NOTION_USER_IDS | tr "," " "); do echo -n '{"object":"user","id":"'$i'"},'; done)
14+
curl 'https://api.notion.com/v1/pages' \
15+
-H 'Authorization: Bearer '"$NOTION_TOKEN"'' \
16+
-H "Content-Type: application/json" \
17+
-H "Notion-Version: 2022-02-22" \
18+
--data '{"parent":{"type":"database_id","database_id":"'"$DATABASE_ID"'"},"icon":{"type":"emoji","emoji":"🐛"},"properties":{"Name":{"type":"title","title":[{"type":"text","text":{"content":"'"$TITLE"'"}}]},"Assigned":{"people":['${people:0:-1}']},"Status":{"select":{"name":"'"$STATUS"'"}},"Type":{"multi_select":[{"name":"bug"}]},"Project":{"multi_select":[{"name":"'"$PROJECT_NAME"'"}]}},"children":[{"object":"block","type":"bookmark","bookmark":{"url":"'"$ISSUE_URL"'"}}]}'
19+
env:
20+
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
21+
STATE: ${{ github.event.issue.state }}
22+
ISSUE_URL: ${{ github.event.issue.html_url }}
23+
TITLE: ${{ github.event.issue.title }}
24+
STATUS: Current Sprint
25+
# Product Work Board
26+
DATABASE_ID: 29876f9a9b864ca39a984f42e17fd345
27+
PROJECT_NAME: Onboard.js
28+
# User ids of who to assign the card to in notion: Taylor, Adam, Aaron
29+
NOTION_USER_IDS: f6cbb362-4908-4138-9ef0-434003d9a9f8,8a3a2287-5d2c-4665-906d-02ae9a113340,3b407adf-6552-40de-b22f-5efa852c34a2
30+
shell: bash

0 commit comments

Comments
 (0)